Skip to main content
Participant
October 26, 2011
Answered

Parsing Values

  • October 26, 2011
  • 1 reply
  • 672 views

Hi

I have an instance of FLVPlayback and can easily set the video to play simply by using the instance name:

flvPlayer.load("resources/lyrics/1/1.flv");

flvPlayer.autoPlay = 1;

The thing is that I want the file to be defined at runtime and so, using my previous examples from AS2 I arrived at:

strVideo = "resources/lyrics/" + path + "/" + track ".flv";

flvPlayer.load(strVideo);

flvPlayer.autoPlay = 1;

Yet this now generates an error with AS3. How do I parse values from the html:

<embed src="experiment.swf?path=1&track=1" />

to AS3 for the FLVPlayback to use this information?

This topic has been closed for replies.
Correct answer kglad

you should use flashvars to pass variables/values to flash from your html.  or, you could use javascript and the externalinterface class.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 26, 2011

you should use flashvars to pass variables/values to flash from your html.  or, you could use javascript and the externalinterface class.

GazziehAuthor
Participant
October 26, 2011

I am now testing out HTML5 and so using the embed code (I will shift away from Flash soon enough anyway but not yet). Also, I have used it without issue for AS2. Surely I can do the same parsing in AS3?

kglad
Community Expert
Community Expert
October 26, 2011

you can use the loaderInfo's url property if you want to parse the swf's query string.