|
-
start/stop
I'm trying to make a .swf file so when you click on it, it'll play. like a start button of sort. I've tryed everything but I can't seem to get it to work. If someone could help please do.
-
you need to be a little more specific...post your .fla code
The easiest way is to put a stop action in frame 1 and then have a button to tell it to play.
in frame 1 put "stop();" minus parenths.
then name the movie clip to whatever you want.
then use the (+) target to assign a gotoAndPlay(2); action or just a play();.... hope this helps.
-
Registered User
You mean anywhere on it? First, the stop(); needs to be at the top of any other actionscript in an actions layer. Then make a layer for an invisible button. Insert a new button symbol and set a keyframe in frame 4 only, of the button timeline. Draw a red fill rectangle, with no line. Position it at 0, 0 and make it 100x100 pixels. Then, back on the main stage, click the first frame where you want the button to show up in it's layer, and drag an instance to the stage. Position in at the top left corner, 0, 0 and then use the properties panel to set the height and width to the size of the stage.
Then the code on the button:
on(release);
_root.play();
}
Or if this swf is loaded to another movie:
on(release);
_root.targetclipInstanceName.play();
}
-
Senior Member
Hi,
in frame 1 of your movie add the actions,
code:
stop(); // have the movie stopped to begin with
this.onMouseDown = function() { // detect the mouse being pressed
play(); // when the mouse is pressed play the movie
delete this.onMouseDown; // and since the onMouseDown function has done all it needed to do we can remove it
};
-
Registered User
Hey Catbert, just an aside, I got the Moock Definitive Guide the other day. Finally....
Going to the next level now.
-
Senior Member
I don't think you'll regret it, its fantastic book, especially the actionscript reference section 
*sits and waits impatiently for "ActionScript for Flash MX2004: The Definitive Guide"*
-
Registered User
I'm starting from the front, doing every example. Would have been nice if it came with a CD, but I'm thinking this is a better way to learn. At least the typesetters didn't mess up the printing job. Another book, the Bible is so full of mistakes you need the CD to find the real working code. 
While it starts out with simple stuff, I don't think this is a beginners AS book.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|