all groups > flash actionscript > october 2004 >
You're in the

flash actionscript

group:

Help with Syntax


Re: Help with Syntax flay
10/8/2004 6:04:12 PM
flash actionscript: Your variables may not be assigned values or your variables are declared
in other scopes.

[quoted text, click to view]
Help with Syntax robsoule
10/8/2004 9:35:26 PM
Hello,

This should be easy but
I'm missing something! I have this line of code:

mySound.loadSound("http://www.mydomain.com/audio/artist/songfile.mp3", true);

where "artist" and "songfile" in the address above are variables. I am having
trouble getting the syntax right to make it work, though. I tried this:


mySound.loadSound("http://www.mydomain.com/audio/"+artistname+"/"+songfile+".mp3
", true);

But I get this error: Error opening URL "http://www.mydomain.com/audio//.mp3"

What am I missing? Thanks!!!

Rob
Re: Help with Syntax kglad
10/8/2004 9:46:57 PM
this code:


mySound.loadSound("http://www.mydomain.com/audio/"+artistname+"/"+songfile+".mp3
", true);

is correct. artistname and songfile are undefined, however. recheck that
they are defined (on the timeline that contains your loadSound() statement).
Re: Help with Syntax robsoule
10/8/2004 9:57:25 PM
They are defined. I am drawing the variables from an .asp file using this code:

loadVariablesNum("recordsong2test.asp", 0);

But I just added a frame in between the lines of code and now it's working!
It's almost like they were going by too fast and Flash wasn't catching them
properly.
Re: Help with Syntax kglad
10/9/2004 5:01:09 PM
if those variables are defined in an asp file, you should use a data handler to
ensure the data are returned before you try and use them. adding a frame is
not a good way to ensure the data are ready when called.
AddThis Social Bookmark Button