Hello,
I’m asking myself how do I passing variables between two swf (html) files For instance how can I request the variable “var_1” in the file blikvanger.swf (or blikvanger.html).
Here is my code of one as file (contact.as):
...
homelink.addEventListener(TextEvent.LINK, linkHandler);
homelink.htmlText = "<a href=\"event:../blikvanger.html\">THUIS</a><br>";
homelink.styleSheet = myCSS;
//function linkHome(event:MouseEvent):void {
function linkHandler(linkEvent:TextEvent):void {
var url:String = "../blikvanger.html";
var variables:URLVariables = new URLVariables();
variables.exampleSessionId = new Date().getTime();
variables.exampleUserLabel = "Home page Yke Ruesink";
variables.var_1 = 'THUIS';
var request:URLRequest = new URLRequest(url);
request.data = variables;
try {
navigateToURL(request, "_self");
}
catch (e:Error) {
// handle error here
}
} //End private function URLContact
From the code above, I’m calling the second file (blikvanger.html). In this file is the swf blikvanger.swf embedded.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="blikvanger" align="top">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="blikvanger.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="#333333" />
<embed src="blikvanger.swf" quality="high" scale="noscale" bgcolor="#333333" width="100%" height="100%" name="blikvanger" align="top" allowScriptAccess="sameDomain" allowFullScreen="false"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
I know alternativ from asp/php:
<a href=\"event:../blikvanger.html?var_1="true"&var_2="etc"\">THUIS</a>
BUT HOW DO YOU EXCHANGE VARIABLES BETWEEN TWO SWF (SWF -> HTML) FILES?
Nico