A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: variable woes

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    18

    variable woes

    with a recent project not unlike my last. i am tryin to use an input text field so you can enter custom stats and refer to these variables later for many different reason. so any help on this subject would be good.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    make use of _global to open the scope of the variable to all timelines in the Player session.
    For example, an input textfield with <instance name> myInput -

    _global.myVar = myInput.text;

    on any movieclip timeline - trace(myVar); will work
    on any loaded movie - trace(myVar); will work

    hth

  3. #3
    Junior Member
    Join Date
    Jun 2006
    Posts
    18
    is there any other ways to go about it?

  4. #4
    Registered User greenham's Avatar
    Join Date
    Mar 2005
    Location
    Australia
    Posts
    555
    Hey Sobek,

    Modified dog's suggestion is probably the easiest way to go about it. It will save you a lot of stress when it comes to targeting your variables. Are you hesistant about using this method for a particular reason?

  5. #5
    Junior Member
    Join Date
    Jun 2006
    Posts
    18
    lol, im hesitant because i dont understand it. i was kinda hoping that entering the value into the input text field, given the variable name in the space that offers it would be enough to create the variable so i could later just use the variable in my commands. but if you could care to explain the components to the said suggestion then please do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center