Skip to main content
Inspiring
January 2, 2013
Answered

Changing frames in a movieclip through a loaded swf file

  • January 2, 2013
  • 1 reply
  • 1656 views

I am creating a game wherein there are 4 buttons. The 4 buttons are baskets with labels of solid, liquid, gas and fire. When the button is clicked, the basket that the catcher/character is holding will change depending on what button is clicked. This time I have connected this part of the game from the other parts. My problem is that everytime I load this part of the game the buttons cannot change the basket my catcher is holding, it cannot change frames. But if it is individually played it is working quite well. Why is that?

This topic has been closed for replies.
Correct answer cams_zalzos

when i put a trace on those frames nothing is happening on the output window. those frames are not being accessed, what should i do to fix it?


it's all finished. i just copied the same frames to all of my catcher objects from the other stages.

1 reply

Inspiring
January 2, 2013

//Code for moving through the frames of my movieclip(catcher)

public function fl_MouseClickHandler(event:MouseEvent):void

                                                     {

                                                     catcher.gotoAndPlay(41);

                                                     soundfx_4.play();

                                                     }

                                                    

                                                     public function fl_MouseClickHandler_1(event:MouseEvent):void

                                                     {

                                                     catcher.gotoAndPlay(81);

                                                     soundfx_4.play();

                                                     }

                                                    

                                                      public function fl_MouseClickHandler_2(event:MouseEvent):void

                                                     {

                                                     catcher.gotoAndPlay(121);

                                                     soundfx_4.play();

                                                     }

                                                    

                                                     public function fl_MouseClickHandler_3(event:MouseEvent):void

                                                     {

                                                     catcher.gotoAndPlay(161);

                                                     soundfx_4.play();

                                                     }

Ned Murphy
Legend
January 2, 2013

Where are the buttons that are being clicked relative to the catcher that you are trying to target.  Your title makes it sound like that code is in a different file than the one with the catcher.

Ned Murphy
Legend
January 2, 2013

yes the buttons are working fine.

public function fl_MouseClickHandler(event:MouseEvent):void

                                                     {

                                                     trace('solid')

                                                     catcher.gotoAndPlay(41);

                                                     soundfx_4.play();

                                                     }

in here i have put a trace the output showed the word 'solid' and the soundfx_4 played fine.

the problem is i cannot access the 41st frame and any other frames in my catcher movieclip.


In your catcher object, try adding traces to the frames you say to go to (41, 81, 121, 161)  just to see if you actually get there or not.  Maybe something is causing them to go and return before you get a chance to see it happen.