A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Odd dynamic text problem

  1. #1
    Junior Member
    Join Date
    Sep 2001
    Posts
    13

    Odd dynamic text problem

    I have a series of check-type boxes that when clicked will either change the value in the dynamic text box from +1 or -1 to determine the number of correct/incorrect selections made. If I have the dynamic text box on the root stage, the values show up just fine.

    If I put the dynamic text box into a movieClip IncorrectMovie and set the variable for the dynamic text box to _root.Correct, the values don't show up. I've also tried _level0.Correct and Correct and none work. All variable settings _level0, _root, etc., work on the root stage.

    I'm not sure what I'm doing wrong. The variable is initially set as Correct = 0;

    I'm using Flash 5.

    Thanks for the assistance.

    Ch@rlie
    Last edited by Cr@zyCh@rlie; 01-17-2004 at 05:20 PM.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    In real life, when you move to another location, its natural to tell your friends you have change of adress. You dont put a sign on yourself with your new location name.
    Its the same here. If the checkboxes send values, it is the check box that has to know where to send it. In this case

    _root.IncorrectMovie.textBoxName=someValueHere;

    ..as this is the new location for the textbox.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Posts
    13
    Actually, pellepiano, the variable is being set in root, and the buttons are changing that value, but when it's called via the dynamic text box within the IncorrectMovie, it doesn't show the value.

    Although, you may be right, I tried that option and that doesn't work, either.

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    ( How would you call a variable via a textbox? )

    The buttons should have something like this then......

    _root.IncorrectMovie.textBoxName=_root..Correct+1;

    ..as the buttons should place the new value of the correct variable (in the root ) into the textbox inside movie IncorrectMovie


    ...or having the movieclip place the variable there ( if you also want to change the variable in the root ). Like having this ON IncorrectMovie

    onClipEvent(enterFrame ){
    Correct=_root.correct;
    }

    Then the texbox will be just a mirror of the _root.Correct

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    Sep 2001
    Posts
    13
    pellepiano,

    I went back through and analyzed all the changes and had a minor typo. The original suggestion worked!

    I added the IncorrectMovie. to the variable location and it worked. I was thinking that when I initialized the variable that was where the value was stored and the variable on the text box matched (not called) the variable amount.

    Good analogy by the way.

    All the best,

    Ch@rlie

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