Google Answers Logo
View Question
 
Q: Flash 8 ( No Answer,   1 Comment )
Question  
Subject: Flash 8
Category: Computers > Programming
Asked by: marypeyton-ga
List Price: $50.00
Posted: 13 Mar 2006 12:49 PST
Expires: 12 Apr 2006 13:49 PDT
Question ID: 706850
Please give me VERY EASY and CLEAR step by step instructions for doing
this in Flash 8:
I want to have a square with a fabric pattern in it and I want the
user to be able to click on the square and it will change to another
pattern. I want it to cycle through 6 different patterns and then
start at the begining again. I have all my images in fireworks and I
know how to import them to the library. I am very new to flash so be
gentle... you can look at the "design studio" on my website to see
what I'm kind of working with if you want to. www.javisdavis.com
Answer  
There is no answer at this time.

Comments  
Subject: Re: Flash 8
From: tomisina-ga on 15 Mar 2006 20:16 PST
 
Summary of what we?re doing:

What I would do, to cycle through 6 different pictures, is create 6
different keyframes in one layer entitled Fabrics.  I would create
another layer that would span across all of those keyframes entitled
Action.  In the Action layer would be ActionScript that advances the
frame one every time the mouse is pressed (unless the current frame is
the last frame, in which case it would go to the first frame).  I was
looking at your site and I think you want this resulting swf (the end
file that Flash outputs) to look like any other picture of fabric ?
but one you can click on.

Step by Step:

1.	Open a new Flash document.
2.	You don?t want this flash to have no extra fat around the edge of
the pictures of your fabrics? So right click on the stage (anywhere on
the document) and click on ?Document Properties...? Set the
?Dimensions? to that of the width and height of your images.  Click
Ok.

3.	You want a separate frame for every picture so we?re going to
modify the timeline to have a frame for every picture.  Click on the
second frame.  Click on the pull down menu ?Insert? => ?Timeline? =>
?Keyframe?.  Click on the third frame and insert another keyframe.  Do
this six times?  You should have blank keyframes up to and including
the sixth frame.

4.	Now you want to add an Action layer to span across the top of all
of those? Click on the pull down menu ?Insert? => ?Timeline? =>
?Layer?.

5.	You can label these layers? Where it says ?Layer 1? you can click
on it and change the label to Fabrics (as it?ll hold the fabric
pictures) and where it says ?Layer 2? you can label that Action (as
it?ll hold the ActionScript).

6.	Relax? We?re halfway there (Save the file somewhere useful... cause
when you test it'll output the swf there too).

7.	Ok now we just need to fill the layers and keyframes with what they
need. Let?s start with the pictures of fabrics? Click on the first
frame in the Fabric layer.  Drag ? Insert ? Paste? somehow get the
first picture of fabric you want in this frame.  What I did was have
your fabrics on my desktop and just dragged one of them into the
frame.  Once it was in the frame I positioned it in the middle of the
stage.  You can make sure it?s exactly in the center of the stage by
clicking on the pull down menu ?Window? => ?Align.? In the Align
Palette make sure ?To Stage? is selected.  Then select the picture of
the fabric on the stage and the ?Align Horizontal Center? (the top row
of buttons in align? second one from the left) and then ?Align
Vertical Center? ? (the top row of buttons in align? second one from
the right).

8.	Do that for a new fabric in every keyframe of Fabrics.

9.	Now click on the first frame of the Action layer (there should be
only one frame that spans across all 6 frames of the Fabric layer). 
Click on the pull down menu ?Window? => ?Actions?.  A new window
should pop up.  Paste the following code in that window:

	this.onMouseDown = function() {
		if(this._currentframe == 6){
			gotoAndStop(1);
		}
		else{
			nextFrame();
		}
	}

10.	Almost done... Now you need to add a stop in every one of the
Fabric keyframes.  With the Action window still open, click on the
first keyframe in the fabric layer.  All of what you pasted in should
disappear... that's OK because that's associated with the action
layer... not the first keyframe of fabric.  What we want to happen
when we get to the first keyframe of fabric is for it to stop.  So in
the Action window associated with the first keyframe of fabric paste
the following code:

	stop();

11.	Do that for every frame in the fabric layer.

12.	You're DONE@!!! Click on the pull down menu ?Control? => ?Test
Movie?.  If you want I'll show you how to put the swf file in html. 
I'm kinda tired of typing right now though...

If you want to check my Flash files I did it and posted it on my file space:  

http://www.andrew.cmu.edu/user/tbs/Google/

You can open the fla file and see how it turned out for me... 

-Tommy

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy