Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1924 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Flash and Actionscript :

Play a movieclip on a button click?

Thread title: Play a movieclip on a button click?
Reply  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
05-29-2007, 01:36 PM
#1
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old  Play a movieclip on a button click?

Hey

I'm doing some extra work in school to get a higher grade (stupid teacher) and i need to know this: I need to make a button that when you click it, a movieclip starts playing, kind of a mouse-over, but with a button click instead.

Thanks,
Jake

Reply With Quote
05-29-2007, 01:54 PM
#2
vitalize is offline vitalize
Status: Member
Join date: May 2006
Location: Australia
Expertise:
Software:
 
Posts: 413
iTrader: 7 / 100%
 

vitalize is on a distinguished road

  Old

Not 100% sure but maybe this will help:

Code:
    on (release) {
        loadMovieNum("filename.swf", 1);
    }
or

Code:
on (release) {
play ();
}

Reply With Quote
05-29-2007, 02:17 PM
#3
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old

i tried the second one, didn't work. And the problem with the first one is, that i don't want to save it as .swf file in order to play it, I want to play a movieclip which is located in the same scene.

Reply With Quote
05-29-2007, 02:38 PM
#4
vitalize is offline vitalize
Status: Member
Join date: May 2006
Location: Australia
Expertise:
Software:
 
Posts: 413
iTrader: 7 / 100%
 

vitalize is on a distinguished road

  Old

This will go to the frame and play from there, idno if thats what you need but thats as far as my flash knowledge goes lol. good luck

Code:
onRelease = function () { 
   gotoAndPlay(3); 
}

Reply With Quote
05-29-2007, 02:41 PM
#5
Sam Granger is offline Sam Granger
Status: Request a custom title
Join date: Feb 2005
Location: The Netherlands
Expertise:
Software:
 
Posts: 2,616
iTrader: 19 / 88%
 

Sam Granger is on a distinguished road

Send a message via MSN to Sam Granger

  Old

Well, dont forget to have a stop in the frame with the button, so it doesnt play beyond the button before you click on it.

Reply With Quote
05-29-2007, 03:49 PM
#6
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

Have a keyframe in the frame you want it to stop (one with button), and on the BUTTON (not just an element, but an actual button), do this:
Code:
on (release) {
     gotoAndPlay(scene); // Should be about one frame after button, if that's the way you made it.
}

Reply With Quote
05-29-2007, 03:51 PM
#7
Bazza` is offline Bazza`
Bazza`'s Avatar
Status: Request a custom title
Join date: Nov 2004
Location: England
Expertise:
Software:
 
Posts: 3,515
iTrader: 10 / 100%
 

Bazza` is on a distinguished road

  Old

When I was in college we used to do it like this

on (release) {gotoAndPlay(2);

}


with the number in the brackets being whatever frame your movieclip starts on.

To stop it repeating just make a new layer and put

stop();

on the first frame.

That should work but I might be a bit rusty as I haven't touched flash in over a year

edit: Just seen that Andrew has just posted practically the same thing so it looks like I remembered rightly for a change

Reply With Quote
05-29-2007, 10:30 PM
#8
derek lapp is offline derek lapp
Status: design rockstar
Join date: Jan 2005
Location: guelph, ontario
Expertise:
Software:
 
Posts: 2,246
iTrader: 0 / 0%
 

derek lapp is on a distinguished road

  Old

you guys have made this problem so much harder than it is.

* make a button
* select it & go to the properties panel (bottom of flash);
* give it an instance name (play?)
* bring your movie clip into the frame.
* go to the properties panel (bottom of flash)
* give it (the movie clip this time) an instance name
* make an actions layer
* open the actions panel (f9, optionF9 on mac)
type this code

Code:
buttonName.onRelease = function() {
	movieClipName.play();
}
putting the code on the button itself like on(release) is back from the kayframe days of flash 5. with the advances in action script and the many, many tiers of movie clips by action script driven files finding the symbol with the code on it is an utter nightmare.

i don't know why you need = function() on the end, you just do. you get used to it.

i attached the zip to show you how easy it really is.

Attached Files
File Type: zip noob.zip (13.0 KB, 311 views)

Reply With Quote
Thanked by:
hamid3pnn (02-03-2013)
07-19-2009, 10:20 AM
#9
hellohelloMio is offline hellohelloMio
Status: I'm new around here
Join date: Jul 2009
Location:
Expertise:
Software:
 
Posts: 5
iTrader: 0 / 0%
 

hellohelloMio is on a distinguished road

  Old

i stil dono how to do the button click
T_T

Reply With Quote
09-04-2009, 01:04 PM
#10
mikenormal is offline mikenormal
Status: Member
Join date: Sep 2009
Location:
Expertise:
Software:
 
Posts: 164
iTrader: 0 / 0%
 

mikenormal is on a distinguished road

  Old

Great help! THX a lot!!!

Reply With Quote
Reply  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed