7 Replies - 1957 Views - Last Post: 08 February 2012 - 01:55 AM

#1 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Movie Clip Buttons

Posted 05 February 2012 - 06:22 PM

I have created some movie clips animated buttons from following http://www.developph...view.php?tid=26
But i cant get them to do anything when they have been clicked I have four of them which i want to GOTO frame 1,77,78,79 when pressed but nothing i've tried seems to work. the code i have so far is

import flash.events.MouseEvent;

//Listens for the mouse over the button and off the button
Home_Button.addEventListener(MouseEvent.ROLL_OVER, btnOver);
Home_Button.addEventListener(MouseEvent.ROLL_OUT, btnOut);

//Same again for the Picture Button
Picture_Button.addEventListener(MouseEvent.ROLL_OVER, btnOver);
Picture_Button.addEventListener(MouseEvent.ROLL_OUT, btnOut);
//and again
Audio_Button.addEventListener(MouseEvent.ROLL_OVER, btnOver);
Audio_Button.addEventListener(MouseEvent.ROLL_OUT, btnOut);
//and again
Video_Button.addEventListener(MouseEvent.ROLL_OVER, btnOver);
Video_Button.addEventListener(MouseEvent.ROLL_OUT, btnOut);
//This acts on any event listener of the mouse over and 
//go's to the 'Button' and plays the first half of the frames
function btnOver(event:MouseEvent) {
event.target.gotoAndPlay("over");
}
//This code does the same again for the mouse out event playing
//the second half of the frames
function btnOut(event:MouseEvent) {
event.target.gotoAndPlay("out");
}


This post has been edited by stevedench2003: 05 February 2012 - 06:26 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Movie Clip Buttons

#2 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Re: Movie Clip Buttons

Posted 06 February 2012 - 05:16 AM

Cs5 Flash As3
With the following the button trace works and reacts when clicked
Picture_Button.buttonMode = true;
Picture_Button.addEventListener(MouseEvent.CLICK, onclick);
function onclick(event:MouseEvent):void {	
	trace("Button clicked");
}


But i need it to go to a frame (the whole point of the button)
I'm new to flash and everyone and their dog has tutorials for movieclip buttons' but not a single one of them actually works, yes the animation of them works but none of them have a click function

Can someone please tell me if am wasting my time trying to find an answer for this.

My project has to be handed in tomorrow and i need to know if i have to redo the buttons as normal buttons (plus the lengthy task of the rewirtting the write up)
Was This Post Helpful? 0
  • +
  • -

#3 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Re: Movie Clip Buttons

Posted 06 February 2012 - 05:44 AM

Let me ask a simple question - Is it possible for a animation button that has been converted to a symbol (movie clip) to gotoAndPlay another frame within the scene when clicked???

I can easily get the button to go to a webpage when clicked but in need it to go to a frame is this possible or not?

Yes/No's will do... better than nothing
Was This Post Helpful? 0
  • +
  • -

#4 razcobhc  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-January 07

Re: Movie Clip Buttons

Posted 06 February 2012 - 09:46 AM

View Poststevedench2003, on 06 February 2012 - 05:44 AM, said:

Let me ask a simple question - Is it possible for a animation button that has been converted to a symbol (movie clip) to gotoAndPlay another frame within the scene when clicked???

I can easily get the button to go to a webpage when clicked but in need it to go to a frame is this possible or not?

Yes/No's will do... better than nothing


Hi, yes it is possible, but it depends on how you've got your frame structure of your *.fla file and other factors. If you can supply the exact details on how and where are the buttons placed, where do you have the code (in a frame, in a *.as file) i'll be happy to help you.


Razvan
Was This Post Helpful? 1
  • +
  • -

#5 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Re: Movie Clip Buttons

Posted 06 February 2012 - 12:24 PM

How do i make a *.as file?
Was This Post Helpful? 0
  • +
  • -

#6 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Re: Movie Clip Buttons

Posted 06 February 2012 - 12:30 PM

my main/first scene is called scene 1 which only has 1 layer and an AS layer and rolls with animation and stops on frame 76. On frame 76 when clicking into the object 'wholeMagicBackground' 4 more layers are available and one of them is the action script layer for the code of the buttons (this code animates the buttons and works) not sure if the AS code for making the buttons go somewhere should be here or somewhere else. If it is then i want this to go back to the main scene layers and each button to go to frame 77,78 & 79. I've had it here but didn;t worok, had it on the top level and it don't see the buttons and lower, also with problems... Not sure if this helps?
Was This Post Helpful? 0
  • +
  • -

#7 stevedench2003  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 29-December 11

Re: Movie Clip Buttons

Posted 07 February 2012 - 02:57 AM

...
Was This Post Helpful? 0
  • +
  • -

#8 razcobhc  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-January 07

Re: Movie Clip Buttons

Posted 08 February 2012 - 01:55 AM

Hi,
Well I don't quite understand your description of how your *.fla is set up. Can you attach the file?
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1