Results 1 to 5 of 5
Thread: Html triggering a flash variable
-
November 6th, 2008, 01:39 AM #1
Html triggering a flash variable
Would it be possible for a flash variable to change based on an html file?
Forgive me if this is a novice question, and I'm sure there are much easier ways to do this using PHP, etc. At the moment I only know Html and CSS
I am using a flash file as my menu, and I'm wondering if there is a way for the html file to trigger flash so that I do not have to make multiple swfs, and cutting down on total files loaded.
Thanks for the info
-Mik
-
November 6th, 2008, 02:24 AM #2
yup, look up flashvars.
flashvars is a parameter when you embed it... flashvars="hello from html".
there are other ways of doing this, like with calling a javascript function from flash also.
or loading an external xml file.
-
November 6th, 2008, 09:02 PM #3
I still don't quite grasp how to declare variables in as3, how would I declare a string to pick up a flashvar?
Would something like this work?
if (root.loaderInfo.parameters.var1 == "1"){
}
-
November 6th, 2008, 10:24 PM #4
Can anyone help me out, even with all the guides out there I still can't seem to get it to work. Here is my code. I've spent 3 hours trying to figure this out ;
Html:
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','494','heigh t','54','title','flash1','src','menu2','quality',' high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','menu2' ); //end AC code
</script><noscript><object classid="clsid
27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="494" height="54" title="flash1">
<param name="movie" value="menu2.swf">
<param name="quality" value="high">
<param name="FlashVars" value="var1=1"></param>
<embed src="menu2.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="494" height="54" flashVars="var1=1"></embed>
</object>
</noscript>
AS3:
import flash.display.LoaderInfo;
var string1:String = getFlashVar("var1");
function getFlashVar(_var:String):String {
var paramObj:Object = LoaderInfo(this.loaderInfo).parameters;
var flashvar:String = String(paramObj[_var]);
return flashvar;
}
Thanks
-
November 10th, 2008, 03:49 PM #554Registered User
postsI only did the object portion but i think you can figure that part out on your own...
your problems start here:
Code:1. <param name="FlashVars" value="var1=1"> delete the </param>
try...Code:2. <embed src="menu2.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="494" height="54" flashVars="var1=1">
see how that works and let us know... good luck!Code:<embed src="menu2.swf?var1=1" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="494" height="54" >
Last edited by maximillion511; November 10th, 2008 at 03:49 PM. Reason: code edit

Reply With Quote

Bookmarks