Copy link to clipboard
Copied
I have been using Flash Professional with AS 2.0 to create flash banners using .flv video, the banners have a button layer to click through to a url. That's all I use Flash Professional for, so I know nothing of Actionscript.
Now working with Flash Professional CC which is no longer supporting AS 2.0.
On the Actions line at frame one I have defined Action 1 in AS 2.0 as follows:
button_99.onRelease = function() {
getURL("http://www.vrcworld.com/common/redirc.ashx?0,0,1226", "_blank");
};
I am getting the following errors when compiling the project:
Scene 1, Layer 'Actions', Frame 1, Line 1, Column 11 | 1119: Access of possibly undefined property onRelease through a reference with static type flash.display:SimpleButton. |
Scene 1, Layer 'Actions', Frame 1, Line 2, Column 2 | 1180: Call to a possibly undefined method getURL. |
Can someone help me to get this fixed for AS 3.0?
Thanks a lot,
Pieter
put this on the first frame of you fla-file, where your button actually is on stage:
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
button_99.addEventListener(MouseEvent.CLICK, _getURL);
function _getURL(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.vrcworld.com/common/redirc.ashx?0,0,1226", "_blank"));
}
Copy link to clipboard
Copied
put this on the first frame of you fla-file, where your button actually is on stage:
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
button_99.addEventListener(MouseEvent.CLICK, _getURL);
function _getURL(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.vrcworld.com/common/redirc.ashx?0,0,1226", "_blank"));
}
Copy link to clipboard
Copied
thanks a lot.
I tried this, get this compiler error:
Scene 1, Layer 'Actions', Frame 1, Line 10, Column 85 | 1137: Incorrect number of arguments. Expected no more than 1. |
applies to this line:
navigateToURL(new URLRequest("http://www.vrcworld.com/common/redirc.ashx?0,0,1226", "_blank"));
Copy link to clipboard
Copied
got it sorted already with my web and db developer, had to move "_blank") to another level, we used this in AS 2.0 to open link in new browser.
This is the right code now:
navigateToURL(new URLRequest("http://www.vrcworld.com/common/redirc.ashx?0,0,1226"), "_blank");
Thanks a bunch for the quick help, much appreciated.
Pieter
Find more inspiration, events, and resources on the new Adobe Community
Explore Now