I am a little new to flash and ActionScript and I have this persistent problem with security I think.
The problem is that. I try to use code for a button in ActionScript 2.0 (i must use 2.0)
on(rollOver)
{
getURL("javascript:someFunction();","_self");
}
This code is supposed to work, it worked for other people =)
Before you say that i am placing it in some wrong place. I place it in the button. Moreover it does work fine, when i try the movie in Flash CS5, using CTRL + ENTER. But when i embed my .swf I get a message something like
the aplication is trying to access page...see parameters for flash player
Sorry for a bad translation.
I also tried this code:
on(rollOver)
{
getURL("http://www.something.com","_self");
}
and it worked.
the embed code:
<object width="100%" height="60">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="wmode" VALUE="opaque" >
<PARAM name="AllowScriptAccess" VALUE="always" >
<EMBED src="small.swf" width="100%" height="60" wmode="opaque" quality="high" AllowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
<noembed></noembed>
</OBJECT>
I should add, that I don't have any power over where the swf file is going to be hosted or anuthing of the sort. It really is not my swf file. All i can do is manipulate it via JAVASCRIPT and for that, I need to get the exact code to work.
if you want to call the JavaScript function from the ActionScript Code. you can use the ExternalInterface API which provided in the ActionScript. Please check the Flash Help you will find out the proper example of the Code for ExternalInterface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With