Copy link to clipboard
Copied
Okay, before I continue, I must say I've searched on forum and on google and all the different kind of code didn't work!
On my actionscript panel, I have this:
import com.greensock.*;
import flash.net.URLRequest;
import flash.display.Stage;
import flash.display.LoaderInfo;
var sujet_no:String = LoaderInfo(this.root.loaderInfo).parameters["sujet_no"];
var timer:String = LoaderInfo(this.root.loaderInfo).parameters["timer"];
var back_url:String = LoaderInfo(this.root.loaderInfo).parameters["back_url"];
var handler_url:String = LoaderInfo(this.root.loaderInfo).parameters["handler_url"];
Then I call then in my functions...
I also tried:
var sujet_no:String = LoaderInfo(stage.loaderInfo).parameters["sujet_no"];
var sujet_no:String = this.root.loaderInfo.parameters["sujet_no"];
var sujet_no:String = LoaderInfo(this.root.loaderInfo).parameters.sujet_no;
var sujet_no:String = this.root.loaderInfo.parameters.sujet_no;
and import flash.display.Stage;... But all returns null (undefined)! I've been passing my parameters like this:
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
<param name="movie" value="http://mySite.com/files/flash/slideshow.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="FlashVars" value="sujet_no=28773&timer=31517703&back_url=http://mySite.com/myPage.aspx?id=50&site_root=http://mySite.com/&handler_url=http://mySite2.com/" />
<param name="swfversion" value="6.0.65.0" />
etc. etc.
P.S. I've been trying for almost 3-4 hours by trying all different methods... :S
Someone got a working sollution to this? Cause I really can't understand why it won't work... It was so much easier in AS2...
I don't have much experience in Flash and I'm new to AS3.
Thanks!
i only see one flashvars in those two sets of param tags. add the second and retest.
Copy link to clipboard
Copied
if you have an ac_fl_runcontent() function in your html, you need to add your flashvars there.
Copy link to clipboard
Copied
Hmmm, I don't have that function... I have to add it in my page?
Copy link to clipboard
Copied
not necessarily. there are several valid ways to embed a swf into an html page and some do not require an ac_fl_runcontent() function.
so,
1. is flash publishing your html file?
2. if yes to 1, are you using cs3, cs4 or cs5 to publish that html?
Copy link to clipboard
Copied
I'm using CS5.
Well, I'll put what I have:
<form id="form1" runat="server">
<div id="slideshow">
<script type="text/javascript" src="<%=ResolveUrl ("~/files/javascript/swfobject_modified.js") %>"></script>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
<param name="movie" value="<%=ResolveUrl ("~/files/flash/slideshow.swf") %>" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="FlashVars" value="<%=GetConfig() %>" /> //returns sujet_no=blabla&timer=0000&etc.
<param name="swfversion" value="6.0.65.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="<%=ResolveUrl ("~/files/flash/expressInstall.swf") %>" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="<%=ResolveUrl ("~/files/flash/slideshow.swf") %>" width="100%" height="100%">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</form>
Note that there are dynamically generated content with C# in this. But the results are correct. I double checked it.
That code was taken from the last integrator, so I'm not familiar with it... It works fine with AS2's FlashVars, but seems like I have now some problems with FlashVars in AS3... :S
Copy link to clipboard
Copied
i only see one flashvars in those two sets of param tags. add the second and retest.
Copy link to clipboard
Copied
Oh right, that was the problem. I can't believe I didn't think about that one sooner (I even have it
at both place on some pages).
It's often the little things that are harder to find! :S
Thanks!
Copy link to clipboard
Copied
you're welcome.