• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamically writing flashvars

Engaged ,
Nov 03, 2008 Nov 03, 2008

Copy link to clipboard

Copied

Can anyone tell me how to get a flashvar into flash without using javascript? Is it even possible anymore?

I have a flash movie embedded in an aspx page that needs to dynamically load an xml file based on a parameter in the querystring. Everywhere I look all I see are posts telling me that the only way to do it is to add the flashvar to the AC_FL_Runcontent script, however I can't be certain that all my clients will have javascript enabled and I know at least a few who are not allowed to have it turned on.

When I use the object and embed tags and add my flashvar param and inline tag I get nothing in the loaderInfo object in my movie.

Am I out of luck with AS3 in this regard?
TOPICS
ActionScript

Views

546

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 03, 2008 Nov 03, 2008
Look at this page, which even includes an ASP example:

http://www.permadi.com/tutorial/flashVars/index.html

then in Flash make sure you're looking for the variables in the main time line. You would say:

var vars:Object=this.loaderInfo.parameters;

and that would give you an object variable, vars, that has each of the things set up in flashvars.

Votes

Translate

Translate
LEGEND ,
Nov 03, 2008 Nov 03, 2008

Copy link to clipboard

Copied

Look at this page, which even includes an ASP example:

http://www.permadi.com/tutorial/flashVars/index.html

then in Flash make sure you're looking for the variables in the main time line. You would say:

var vars:Object=this.loaderInfo.parameters;

and that would give you an object variable, vars, that has each of the things set up in flashvars.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

Thank you for the link Colin.

I got it working, but I noticed a little hiccup. The Event.COMPLETE event never seems to fire in IE7 when you add your event listener to the loaderInfo object.

I added the listener to Event.INIT and now it seems to be working fine. Thanks again for the link to the tute!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

As far as I know the loaderinfo is there as soon as the swf opens. I've never used a listener to wait for it.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

LATEST
Interesting. I simply copied the code from the link you send me wholesale. The author is using an event to verify the loaderInfo object is completed. I don't know what the deal with that is, but either way it works. Thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines