Skip to main content
Participant
April 20, 2010
Answered

Accessing Button inside Movieclip/ScrollPane

  • April 20, 2010
  • 1 reply
  • 540 views

Hello all,

I'm trying to understand how to build a button inside a movieclip.  I have a template that has movieclips within movieclips, and when I create a button (all using AS2) the button will work if I test the scene, but in the whole flash movie it does not work.  I also have some buttons located inside a ScrollPane that also do not call correctly.

For my button I am using this code:

facebookbtn.on (release) {

getURL("http://www.facebook.com/","_blank","GET");

}

^ This is placed on the button "facebookbtn". I also tried using: _root.bgPages.pg1.facebookbtn.on (release), to no avail.

For the one inside a ScrollPane I am attempting to call a javascript function:

on(release){

     import flash.external.ExternalInterface;

     ExternalInterface.call("GroupDelegate","dayone1");

}

^ This also does not work, with or without the button name before on(release).

I'm putting the FLA file here so that if anyone has the time, could help me with this quick problem. Thanks!

FLA: Download FLA

This topic has been closed for replies.
Correct answer Ned Murphy

Different code is used depending how you assign it... what you show seems to be mixing up both ways...

If you are placing that code on the button, use:

on (release) {

     getURL("http://www.facebook.com/","_blank","GET");

}

If you are placing that code in the timeline that contains the button, be sure that you have given that instance name to the button (in the properties panel, not the library), then use this code:

facebookbtn.onRelease = function() {

     getURL("http://www.facebook.com/","_blank","GET");

}

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
April 20, 2010

Different code is used depending how you assign it... what you show seems to be mixing up both ways...

If you are placing that code on the button, use:

on (release) {

     getURL("http://www.facebook.com/","_blank","GET");

}

If you are placing that code in the timeline that contains the button, be sure that you have given that instance name to the button (in the properties panel, not the library), then use this code:

facebookbtn.onRelease = function() {

     getURL("http://www.facebook.com/","_blank","GET");

}