Copy link to clipboard
Copied
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! 🙂
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 sele
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you, Ned. I checked the publish settings, and they are set to AS1. Is there any other place I should check?
Copy link to clipboard
Copied
Make sure you are selecting MoveClip or Button objects and not graphic symbols or raw drawn graphic elements (Shapes).
When you select the object, look in the Properties panel and see what type of object it is identified as in there. If it indicates it is a graphic or a shape, you cannot apply code to those.
Copy link to clipboard
Copied
Hmmm. Well, if I right click on the button in the library and select Properties, it says it's a button, but if I have it open on the stage and I select it on Up Over Down or Hit the Properties panel says they are shapes.
Do you know whether I can change them to buttons, or do I have to start over from scratch?
Thanks for your help!
Copy link to clipboard
Copied
Whatever is inside the button you do not want to assign as buttons. The enclosing button will override them anyways. Basically you can't put code inside a button because it won't work anyways.
You could create movieclips and use them as buttons, but then you need to code the button behaviors that are built into buttpon symbols, such as the up/over/down/hit frames.
You could build the buttons inside the movieclip and they would work as well.
If you want to change how the existing buttons work, then you need to assign the code to the button, not its innards.
Copy link to clipboard
Copied
Thank you! OK...this may be a really stupid question, but I still can't get the button to open up so I can assign code to it. I try right-clicking it from the library and choose Edit, then go up to Window and choose Actions (F9), but I still get the message "Current selection cannot have actions applied to it." Am I missing something?
*Sorry for the late reply-I've been out for a few days.
Copy link to clipboard
Copied
As I just said, you cannot place code inside a button.
Copy link to clipboard
Copied
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."
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
"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."
This is the answer I needed--the piece I was missing. And I thank you for it. I could do without the snark.
Copy link to clipboard
Copied
Apparently you cannot do it without adding snark. You're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now