dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: loading vars from URL

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    17

    Angry

    want to load in some variables from the url, for example:

    http://www.mydomain.com/flash.asp?data=var1,var2

    anyone know if it is possible to load var1 and var2 into FlashMX as a string?

    oh yeah, the SWF that needs these vars is also loaded onto this page... if that helps.. ; |

    ta

  2. #2
    Junior Member
    Join Date
    Jan 2001
    Posts
    13
    Just take a look at the LoadVars function in your Flash help

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    17

    just experienced this

    I have just had to figure this out....and am currently testing it (although there seems to be some playing bugs on mine but that won't effect the vars.)

    Check out my source on...
    http://www.ednet.co.uk/~squarepeg2/test/soundplayer.fla
    http://www.ednet.co.uk/~squarepeg2/test/playertest.html

    and check http://www.flashkit.com/tutorials/Ac...73/index.shtml for a tutorial on this site.

    If anyone would like to test the fla and let me know if its working I would really appreciate it. I can't figure out why its not playing.

  4. #4
    NerdInside's Avatar
    Join Date
    May 2001
    Location
    Penguin Island
    Posts
    3,439
    If you had a var in the movie, such as myVar, you could change it from a query string (but not the URL query string, the SWF query string!!!). In the HTML coding of the SWF, find the 2 URL's that point to your SWF. Just add a ?myVar=New text&myVar2=Newer Text and now the SWF has new vars.

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    17

    Smile

    WICKED.

    You are a star, kickn!!! Combine this with a smidgin of VB and you get dynamic querystring vars to Flash..

    ha HAAAA.

    v good v good.. yes yes yes.. thank you again.

  6. #6
    Junior Member
    Join Date
    Jan 2001
    Posts
    19
    Regarding the last 2 posts...how do i reference the variables though?

    I've tried _root.varname but I can't seem to get the values!

    Is there a way for me to debug the .swf or display the contents of the variable...to see if it's working?

    I'm trying to send the name of a .mp3 file and then open it using the following code:

    ***********************************

    myFile = "../demos/" & _root.id;
    mySound = new Sound();
    mySound.loadSound(myFile, true);
    mySound.start();
    stop();

    ***********************************

    But it don't work!...works find when I substitute the _root.id bit for the actual name of the file though...

    myFily = "../demos/test.mp3"

    my appropriate part of my HTML code looks like this:

    param name=movie value="../demos/play.swf?id=test.mp3"
    ...etc...
    embed src="../demos/play.swf?id=test.mp3" etc....

    Anyone got any ideas...i'm getting desparate now!

    Cheers


    Wayne

  7. #7
    Junior Member
    Join Date
    Jan 2001
    Posts
    19
    Solved my own problem...proved to be the syntax I was using to join the strings...should have been a '+' and not a '&'

    DOH!

    Cheers


    Wayne

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