Skip to main content
Known Participant
December 22, 2010
Question

Action Script and Button help

  • December 22, 2010
  • 1 reply
  • 1798 views

I am following a tutorial on making a flash site so I know how to make one for a client of mine, Im following the instruction peice by pecie. Its as follows

(where Im currently at😞

Making The Music Buttons
1. From Scene1, make 1 button. (Insert>New Symbol)and call it genericbutton. (Check)

2. In layer 1, click on the frame under Hit state and press F7 to insert a blank keyframe. Draw out a small rectangle. Remember, you only need th fill. If you have a stroke, delete it. It just adds to file size. Also, color doesnt matter. This generic button is a hot spot (image map). (Check)

3. Use the Align panel to center align this rectangle to stage. (Check)

4. In Scene1, the track buttons layer, drag out 5 instances of the generic button. Place one instance over each number, and one instance over the "off". You may need to scale these instances so they fit nicely over the text. (Check)

5. Click on the button that is over the number 1 and insert the following Objeck Actions:
on (release) {
    stopAllSounds ();
    with (music1) {
      gotoAndStop (2);
    }
    with (music2) {
      gotoAndStop (1);
    }
    with (music3) {
      gotoAndStop (1);
    }
    with (music4) {
      gotoAndStop (1);
    }
}

Now, I click on that image hopt spot, go to actions, and it will not allow me to put any actions over that image hotspot. I get the following message on the Actions Panel "Current selection cannot have actions applied to it". For anyone else that been working with Flash longer than I have, what might be going on and why won't this work? Im actually thinking about installing Flash5 on here, maybe I will have a little bit more succes. Any suggestions would be great. Thank you.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 23, 2010

you should really find another tutorial.  attaching code to objects is either poor coding or antiquated.

but your immediate problem is that you're not clicking on a button in step 5.  and you're posting in the wrong forum.  or, maybe you're not.

you're using as1 coding.  if you're publishing for as3, then you can NOT attach any code to objects and you sure can't attach as1/as2 code to anything and publish for as3.

Known Participant
December 24, 2010

I just did the whol tutorial on making a flash website with working sound using Flash 5, and..... It KINDA worked. When I ctrl+enter to test the file, the audio track automatically plays instead of being off and pressing a button to play them. Also, in the output box, I get a whole lot of these.....

Scene=Scene 1, Layer=track buttons, Frame=1: Line 1: Mouse events are permitted only for button instances
     on (release) {

Symbol=images, Layer=button forward, Frame=5: Line 1: Mouse events are permitted only for button instances
     on (release) {

Symbol=images, Layer=button back, Frame=5: Line 1: Mouse events are permitted only for button instances
     on (release) {

Symbol=images, Layer=button forward, Frame=9: Line 1: Mouse events are permitted only for button instances
     on (release) {

Symbol=images, Layer=button forward, Frame=18: Line 1: Mouse events are permitted only for button instances
     on (release) {

Symbol=images, Layer=button forward, Frame=28: Line 1: Mouse events are permitted only for button instances
     on (release) {

Then, when I click on the side buttons (chair, cycle and taxi) I created to open up pages for images, I get this.....

Error: A 'with' action failed because the specified object did not exist.

What could be going on and why?

Also, are there any better tutorials out there for creating a flash website as this is my 1st go at creating one? If there are any, any help in the right direction would be greatly appreciated. Thank you.

kglad
Community Expert
Community Expert
December 24, 2010

you're publishing for as3 and you're using as2 code.  change one of those.