Skip to main content
Participating Frequently
May 16, 2013
Answered

Editing Buttons in an Old Flash Movie

  • May 16, 2013
  • 1 reply
  • 1396 views

Hello,

I am trying to edit a Flash movie that was created several years ago (probably around 2002-2004ish), using ActionScript 1. It's a library map that shows Library of Congress subjects when you hover over the stacks buttons. Here is a link to show what I am talking about: http://lib.skidmore.edu/includes/files/SubjectMaps/subjectmap.swf

Click on the BY SHELF button to see the action I wish to edit.

What I would like to do now is, instead of just the hover-over feature, I'd like to make each shelf button link to a Library of Congress search in our catalog when you click on it. However, when I try to edit the buttons, they won't appear in the ActionScript window, and I get the message "Current selection cannot have actions applied to it." I've read several forum and web questions regarding this, but I'm not using ActionScript 3, and I can't figure out how to open the button up and add code to it. Is this possible?

I'd very much appreciate any help! 🙂

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

I'm sorry, but then how *do* I assign code to a button? What am I doing wrong? I truly do not understand.

This is the question I seek the answer to:

"If you want to change how the existing buttons work, then you need to assign the code to the button, not its innards."


That is not a question, but I will try to explain the proper way to code a button.

Select the button on the stage, then enter a name for it in the Properties panel where it says "<Instance name>"... one word, no spaces in it.  Let's say you name it "btn" (without quotes)

The button is now ready to have code assigned to it.

In the timeline create a layer that you will use for actionscript.  In the frame of that new layer that is the same frame number as the button, assign code to the button by selecting the frame in the actionscript layer and typing the following in the Actions panel...

btn.onRelease = function(){

       trace("this button works");

}

Once you have that working, replace the trace with whatever functionality you intend to code for the button.

To get rid of any code that might be attached to the button that was already there, select the button on the stage while the actions panel is open and you should see any code attached to the button.  Attaching code to buttons is bad practice, so get rid of it and move it into the timeline in the timeline format.

1 reply

Ned Murphy
Legend
May 16, 2013

Doublecheck you Publish Settings to make sure AS3 is not selected.  That message is an AS3 message if you are selecting an object in the stage.

Participating Frequently
May 16, 2013

Thank you, Ned. I checked the publish settings, and they are set to AS1. Is there any other place I should check?

Participating Frequently
May 22, 2013

As I just said, you cannot place code inside a button.


I'm sorry, but then how *do* I assign code to a button? What am I doing wrong? I truly do not understand.

This is the question I seek the answer to:

"If you want to change how the existing buttons work, then you need to assign the code to the button, not its innards."