SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2002
    Location
    london
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    variable as part of a target path

    hi amigos

    i want to use a variable as part of a target path.

    example:

    i have a variable which contains another variable name.

    section = section_1;

    the variable name "section_1" changes depending on a selection made in a drop down menu.

    i also have an input text box "textbox", and a button and a movie clip "mclip" which holds variables to pass to another movie.

    what i want to do is, when the button is pressed have the contents of the variable "section" assigned to "mclip" as part of a target and then assign the value of the input text box to this new variable. so the end result would be something like

    on (release) {
    _root.mclip.section_3 = _root.textbox
    }

    is this possible?

    any ideas/suggestions greatly appreciated

    ..L
    give me all your lentils

  2. #2
    SitePoint Enthusiast Roxy's Avatar
    Join Date
    Feb 2002
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried

    on (release) {
    set ("_root.mclip." + section, "_root." + textbox);
    }

    ("Expression" checkboxes are on)?
    Should work.

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2002
    Location
    london
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey roxy

    thanks for your reply

    someone else suggested i do it like

    on (release) {
    eval("_root.mclip."+section) = _root.textbox;
    }

    but the thing is i cant use it at all now....

    what i was trying to do was build this kind of text editor thing but it wont work because you cant paste into an input field in a swf, which is pretty stupid really. but thanks for your suggestion.

    take it easy

    ..L
    give me all your lentils


Bookmarks

Posting Permissions

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