Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    119
    Thanks
    1
    Thanked 0 Times in 0 Posts

    get url variable to flash

    Hi, i'm getting an url variable to flash using some javascript code.

    Everything works fine and i get the variable to my dynamic text field but only on the root. if i put the text field on a movie clip it don't work anymore. Any clue on how to fix it?

    i'm getting the variable with
    Code:
    <param name="movie" value="teste.swf'+document.location.search+'" />
    on the flash i just write the variable name and it works.
    something like http://www.kirupa.com/nome.html?var1=alapimba

    and alapimba appears on my flash file.

    What can i do to fix this?

  • #2
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    From your movieclip you need to call the variable which is in the root like this _root.var1

  • #3
    Regular Coder
    Join Date
    Jul 2006
    Posts
    119
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by gani View Post
    From your movieclip you need to call the variable which is in the root like this _root.var1
    and how can i assing that variable to the text field?
    right now i just wrote the var name on the dynamic text field and it worked. no actionscript involved at all

  • #4
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    Don't give the text field a var name. Instead give it an instance name. Then in your actions panel you can write:
    Code:
    textfield_name.text = "some text";
    //or in your case
    textfield_name.text = _root.my_input_variable;
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com


  •  

    Posting Permissions

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