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 1240 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Flash and Actionscript :

flash play on click

Thread title: flash play on click
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
08-27-2007, 03:16 PM
#1
lcphotostudio is offline lcphotostudio
Status: Member
Join date: Dec 2006
Location: Torrington, Ct, USA
Expertise:
Software:
 
Posts: 127
iTrader: 1 / 100%
 

lcphotostudio is on a distinguished road

Send a message via AIM to lcphotostudio Send a message via MSN to lcphotostudio Send a message via Yahoo to lcphotostudio

  Old  flash play on click

i have an animated banner that plays and stops. how do i make it play on click? other than the reload.

thanks

08-27-2007, 03:47 PM
#2
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

Code:
myElement.onclick = function() { play(); }

08-27-2007, 06:05 PM
#3
lcphotostudio is offline lcphotostudio
Status: Member
Join date: Dec 2006
Location: Torrington, Ct, USA
Expertise:
Software:
 
Posts: 127
iTrader: 1 / 100%
 

lcphotostudio is on a distinguished road

Send a message via AIM to lcphotostudio Send a message via MSN to lcphotostudio Send a message via Yahoo to lcphotostudio

  Old

mabey i didnt put it in right. i made a new layer called action and put the code in the first frame. once the movie is done playing will this script make it play again on click?

08-27-2007, 07:34 PM
#4
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

if you put play(); in the first frame, it just tells a movie that's already playing to play. when it reaches the end, there's no new code to execute.

in your new layer, go to the last frame, make it a keyframe if it isn't - since the movie stops, i expect it to be a keyframe. place a button somewhere - if you just want it to just a click anywhere on the movie kind of button just make a transparent button and make it the movie size. also give your button an instance name.

select the keyframe and NOT the button itself, open the actions panel and type the following:
Code:
buttonname.onRelease = function() {
	gotoAndPlay(1);
}

08-29-2007, 01:00 AM
#5
lcphotostudio is offline lcphotostudio
Status: Member
Join date: Dec 2006
Location: Torrington, Ct, USA
Expertise:
Software:
 
Posts: 127
iTrader: 1 / 100%
 

lcphotostudio is on a distinguished road

Send a message via AIM to lcphotostudio Send a message via MSN to lcphotostudio Send a message via Yahoo to lcphotostudio

  Old

i followed your directions but it keeps looping, should i put a stop somewhere

thanks

08-29-2007, 02:35 AM
#6
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

i'm not sure how you have the file set up, but based on what you said my understanding of it is this:

you want your movie to play automatically and stop when it reaches the end. then, you want the option to replay?

if so, go your last frame add stop(); to the actions panel then follow my previous instructions:
* insert new layer
* on last frame insert keyframe
* add button to key frame
* give button instance name & add button code to actions panel

the other scenario i see is you want it to wait for a click to activate.

if so:

* insert new layer
* add button & code to first frame
* select all frames and drag them over 1 frame
* put stop(); into the actions panel on frame 1 - so now your first animation frame and button are on frame 2
* make the button code point to frame 2 instead of 1. - i avoid using play() because with some of my past experiences triggering actions really fast confused flash and it screwed up the timing.

08-29-2007, 10:41 AM
#7
lcphotostudio is offline lcphotostudio
Status: Member
Join date: Dec 2006
Location: Torrington, Ct, USA
Expertise:
Software:
 
Posts: 127
iTrader: 1 / 100%
 

lcphotostudio is on a distinguished road

Send a message via AIM to lcphotostudio Send a message via MSN to lcphotostudio Send a message via Yahoo to lcphotostudio

  Old

Originally Posted by derek lapp View Post
i'm not sure how you have the file set up, but based on what you said my understanding of it is this:

you want your movie to play automatically and stop when it reaches the end. then, you want the option to replay?

if so, go your last frame add stop(); to the actions panel then follow my previous instructions:
* insert new layer
* on last frame insert keyframe
* add button to key frame
* give button instance name & add button code to actions panel
this is what i would like it to do,

i put a stop in the last frame,

now it plays, stops, and the cursor changes to a hand and stays that way, but when i click nothing happens. i have the code from the previouse post, its in the last key frame of the button layer, i have the instance name and the name in the code the same.


thanks
Lisa

08-29-2007, 01:16 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

where did you place the button code? my first instinct is you might have had the button selected when you entered the code into the actions panel instead of having the frame selected. in that case, the code won't execute but i can't remember if flash gives you a warning when that happens.

i've made a quick test movie to show you what i did.
http://www.vectorthis.com/temp/replay.fla

08-29-2007, 04:59 PM
#9
lcphotostudio is offline lcphotostudio
Status: Member
Join date: Dec 2006
Location: Torrington, Ct, USA
Expertise:
Software:
 
Posts: 127
iTrader: 1 / 100%
 

lcphotostudio is on a distinguished road

Send a message via AIM to lcphotostudio Send a message via MSN to lcphotostudio Send a message via Yahoo to lcphotostudio

  Old

i put the button code on the last keyframe i had the keyframe selected when i entered the code.

thats strange. im must be missing something, i have it set up like you do but it wont replay

http://www.skytopdesigns.com/rmn/images/movie2.fla

08-29-2007, 08:03 PM
#10
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

  1. your put the keyframe on frame 1, so at the end of the movie, there's nothing to execute
  2. you need a button to trigger the code
  3. this.onRelease = function(){ this.gotoAndPlay(2); } 'this' refers to the frame. onRelease (and the others) only apply to buttons as you can't press/release a frame. the button (that you didn't make) needs to be released

http://www.vectorthis.com/temp/movie2_works.fla

Closed Thread  
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