Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

converting from AS 2.0 to 3.0 need help

New Here ,
May 06, 2014 May 06, 2014

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 111119: Access of possibly undefined property onRelease through a reference with static type flash.display:SimpleButton.
Scene 1, Layer 'Actions', Frame 1, Line 2, Column 21180: Call to a possibly undefined method getURL.

Can someone help me to get this fixed for AS 3.0?

Thanks a lot,

Pieter

TOPICS
ActionScript
400
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , May 06, 2014 May 06, 2014

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"));

}

Translate
Guru ,
May 06, 2014 May 06, 2014

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"));

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2014 May 06, 2014

thanks a lot.

I tried this, get this compiler error:

Scene 1, Layer 'Actions', Frame 1, Line 10, Column 851137: 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"));

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2014 May 06, 2014
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines