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

AS3 button question swfaddress

Guest
Apr 07, 2013 Apr 07, 2013

I am trying to transition from as2 to as3 its been going very slow I have added as3 swfadress successfully my problem is that I dont want to use movieclips instead of buttons here is what i have

i have this on frame 2

// SWFAddress actions
function btnClick(e:MouseEvent) {
SWFAddress.setValue(e.target.deepLink);
}
function btnRollOver(e:MouseEvent) {
SWFAddress.setStatus(e.target.deepLink);
}
function btnRollOut(e:MouseEvent) {
SWFAddress.resetStatus();
}

// SWFAddress handling
function handleSWFAddress(e:SWFAddressEvent) {
try {
  if (currentFrame == 2 && e.value == '/') {
   play();
  } else {
   gotoAndStop('$' + e.value);
  }
} catch(err) {
  gotoAndStop('$/error/');
}

}
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress);
stop();

then in the movie clips i have the below code

this.deepLink = '/home/';

this.buttonMode = true;

this.addEventListener(MouseEvent.CLICK, (parent as MovieClip).btnClick);

this.addEventListener(MouseEvent.ROLL_OVER, (parent as MovieClip).btnRollOver);

this.addEventListener(MouseEvent.ROLL_OUT, (parent as MovieClip).btnRollOut);

however using this setup I would like to use buttons instead of movieclips how do i accomplish this because in as3 you cannot add code in a button

TOPICS
ActionScript
402
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 ,
Apr 07, 2013 Apr 07, 2013

Why do you want to use buttons instead of movieclips?  What feature are you looking to utilize that movieclips don't support?  Have you considered using a button inside of a movieclip?

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
Guest
Apr 07, 2013 Apr 07, 2013
LATEST

Well thats a good question and as i look at my issue i need to face it instead of running I want to animated it and found some documents on how to but my biggest issue is using swf address  my external buttons dont work now they do nothing

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