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

Could someone help me to convert this AS3 into AS2 please?

New Here ,
Jan 31, 2013 Jan 31, 2013

I'm really new to AS3 and I built my first clickable menu thingy a few weeks ago. But the system the SWF needs to play through doesn't allow AS3, which is not something I was told before writing it. I'm only just muddling through AS3, so converting this to AS2 is proving really tricky. Can someone help please? I've tried a few things but nothing works, so a point in the right direction would be great! Thanks!

lightingButton.addEventListener(MouseEvent.CLICK, addlightingpopup);

var movieClipLight:LightingPopup

var buttonCloseLight:Close

function addlightingpopup(event:MouseEvent):void

{

  movieClipLight = new LightingPopup();

  _visible(movieClipLight);

  movieClipLight._x = 500;

  movieClipLight._y = 240;

 

  buttonCloseLight = new Close();

  addChild(buttonCloseLight);

  buttonCloseLight.x = 820;

  buttonCloseLight.y = 56;

 

lightingButton.removeEventListener(MouseEvent.CLICK, addlightingpopup);

buttonCloseLight.addEventListener(MouseEvent.CLICK, removelightingpopup);

}

var movieClipLightComplete:CompleteIcon

function removelightingpopup(event:MouseEvent):void

{

  movieClipLightComplete = new CompleteIcon();

  addChild(movieClipLightComplete);

  movieClipLightComplete.x = 830;

  movieClipLightComplete.y = 48;

 

  removeChild(movieClipLight);

  removeChild(buttonCloseLight);

  movieClipLight = null;

  lightingButton.removeEventListener(MouseEvent.CLICK, removelightingpopup);

  buttonCloseLight.removeEventListener(MouseEvent.CLICK, removelightingpopup);

}

TOPICS
ActionScript
300
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
LEGEND ,
Jan 31, 2013 Jan 31, 2013
LATEST

The closest thing to creating a dynamic instance of an object in AS2 would probably be to use the attachMovie function/method to add an object from the library.  The removeMovieClip function is used to remove it.  If you search Google using terms like "AS2 attachMovie" you should be able to find a tutorial to help you thru whatever you need to do.

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