A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Variable given a value, but the value won`t show up.

  1. #1

    Variable given a value, but the value won`t show up.

    I have trouble with showing the value in a variable.

    I have nested alot of mc`s into eachother, and the reference the the variable is right.

    In that movieclip which I have got the textfield I also have a button. The textfield is on the 1st layer, so it`s not the button which is on top of the textfield, which could be a reason why I don`t see the variable value.

    I have used a trace function to check if the variable gets the value, and it does.

    The movieclip which consists of the textfield and button is instanced 6 times in another movieclip. Instancenames is Product1..Product2...etc.

    The textfield variable is named Productname

    The font color is not the same as the background color of the button which the textfield is on. So it`s not that which are the problem either.

    I want to assign the name on the buttons not manually. If I do that manually I must make a new movieclip consisting of the same button and textfield with just another productname in that textfield. If I go to the movieclip which I have the 6 instances of the movieclip with the button and text and write something in one of the instances the text will be the same on the 5 others.

    Textfield is set to Dynamic Text.

    I just don`t understand what could be wrong. I have another textfield which is named Totalsum in a movieclip called sum and it works well.


    Hope someone understand the problem and can suggest something to solve it.


  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    what is the target path of the variable and what code is on the button? (it's the button action that sets the var value right?)
    gparis

  3. #3
    gparis:

    I set the variable in the first frame on the main timeline.

    The path is: (It`s originally in norwegian, just translated it for you to understand)

    _root.background.Searchpage.CategorySearch.MainCat egory.CategoryMenu.Product1.Productname = "Computers";

    This is just to test. I shall make a for loop to refer to "Product"&counter&".Productname = ProductArray(counter);
    when/if I get it to work.

    The main purpose is to "name" the buttons.

    Like |-----------
    |Computers |
    __________ |
    ------------
    |Videocamera`s|
    |-----------

    Etc... now they are just empty. Clicking on them should make a subcategory of each MainProduct come up.




  4. #4
    Sorry for the bad ASCII art....it should look like buttons.


  5. #5
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    If your path is right it should work.
    Is you fla big? i could take a look if you wish.. You are sure about all points, i mean, you troublechecked the color of font in dyn. textbox? if the trace works that would mean you path is right (did you trace with the path you wrote? did you use the target path icon to make sue all instance names were ok and well entered (this happens sometimes too, you enter instance name and it does not compute)
    gparis

  6. #6
    gparis

    The Fla file


    The Fla file is 41 kb. The text is in norwegian, so maybe abit confusing.

    I traced the path. I did use the target path.
    Maybe I do nest to much movieclips into eachother....after a while I get confused )



  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    hi again Wain,
    from what i saw (the var is supposed to appear when you click on the middle button : SOR) the problem is that your clip produkt1 is on a masked layer so you need to embed the font in the dyn.textbox .
    hope this helps
    gparis

  8. #8
    gparis:

    Thank you very much. It worked.

    But I don`t understand why it must be embedded. Gotta try to find it out by reading the manual.

    Thanks for taking time helping me



  9. #9
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You're welcome:)
    That's a rule.. i cannot tell you exactly why but if animated or masked the dynamic textfield must be "embedded" therefore turned into a graphic..
    gparis

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