Developing Webs logo
Google
Web DW-Main DW-Photoshop
Visit the message board for solutions or post a question Check out the Classes offered for free at Developing Webs Voice Chat submit a tutorial, resources, article, font for publication consideration and earn a one way link back to your site Get more specifics about the Developing Webs Voice chat room and its room members View the current news at Developing Webs alternative sites which are resources for your d3evelopment needs Join Developing Webs Chat Link to us on your web page to help support this resource! Check out Developing Webs At yahoo groups! Developing Webs Home Adobe Photoshop Tutorials Macromedia Flash Tutorials Jasc Paint Shop Pro Tutorials Adobe Illustrator Animation basics Some Basic PHP tutorials Perl Tutorials HTML Tutorials Cascading Style Sheets javascript Front Page Tutorials Macromedia Dream Weaver Tutorials dreamweaver Publishing your site, FTP, ChMod, Promotions Tools to help you create your site Free and shareware fonts to download Photographs to use in your projects Shop for your site needs Free Online classes REcommend this site to others Log in or edit your information when logged in Developingwebs Log Out Change My Account details and preferences
RSS Newsfeed
for your site
DW News
Calendar
DW Forum
Right click on button and copy shortcut

Add to My Yahoo!

Reminder
Remember to book mark this site!



Request a Tutorial

Digital clock Phase 2

Flash MX

Using Action Scripts you can change the behavior of your Flash Program based on the time of day. 

In Phase 2 we will affect how our movie appears based on the tome of day using action  "Action Script".

Test it out on the right==>

Follow along with the modify_based_on_time_of_day.fla as you go through the tutorial

   

 

1. Open a the digital clock movie from last week.  If you do not have it you can down load it from last weeks tutorial.

2. Click Insert / New Symbol. Name it "sun", set behavior to graphic.

Select circle tool, make fill yellow, draw a circle 50 pixels in diameter.

 

3. Click Insert / New Symbol. Name it "moon", set behavior to graphic.

Select circle tool, make fill silver, draw a circle 50 pixels in diameter.

 

4. Click Insert / New Symbol. Name it "filter", set behavior to graphic.

Select rectangle tool, make fill black, draw a rectangle 550 wide by 400 high pixels in diameter.

 

5. Click Insert / New Symbol. Name it "filter movie", set behavior to movie.

Drag the "filter graphic" onto the stage. 

"Insert Frame" in frame 24.  "Insert Key Frame" in frames 4, 6, 20, 22.

In frame 6 change the "Color Alpha" to 0 for the "filter" graphic.

In frame 20 change the "Color Alpha" to 0 for the "filter" graphic.

In frame 4 set Tween to motion.

In frame 20 set Tween to motion.

Lock Layer 1.

 

6. Add a Layer. (Layer 2).

"Insert Key Frames" in frames 4, 5, 13, 19, 20, 24. 

In Layer 2 frame 1 Drag the "moon" graphic to the top center of the stage.

In Layer 2 frame 4 Drag the "moon" graphic to the right half way down just off the stage.

In Layer 2 frame 5 Drag the "sun" graphic to the left half way down just off the stage.

In Layer 2 frame 13 Drag the "sun" graphic to the top center of the stage.

In Layer 2 frame 19 Drag the "sun" graphic to the right half way down just off the stage.

In Layer 2 frame 20 Drag the "moon" graphic to the left half way down just off the stage.

In Layer 2 frame 24 Drag the "moon" graphic to the top center of the stage.

In frame 1 set Tween to motion.

In frame 5 set Tween to motion.

In frame 13 set Tween to motion.

In frame 20 set Tween to motion.

Lock Layer 2.

 

7. Add a Layer. (Layer 3).

Add Action script of "stop". (+ / Actions / Movie Control / stop)

 

8. Go to Scene 1 Layer 1 frame 1.

Drag the "filter movie" on the the stage and center it so it covers the whole stage.

With the "filter movie" selected click on Modify / Arrange / Send to back.

 

9. Open the Actions panel for "filter movie".

+ actions / movie clip control / onclipevent / enter frame

+Actions / Variables / set variable

in variable type "daynight"

in value + Objects / Core / Date / newdate

+ Actions / Variables /set variable

in variable type "dayframe"

in value type "daynight." + objects / core / date / methods / getHours

after the ( ) type "+1"

click expression

+ Objects / movie / MovieClip / Methods / gotoAndStop

click the target click relative and click "this".

In parameters type "dayframe". 

 

Your script should look like this

 

 

10. close the Action Script panel.

 

11. Insert frame so you now have a 2 frame movie.

 

Save and Test your movie.

 

Prepared by Theodorb.



"Building The Web Into a Nicer Place -- One Site At A Time"
Developing Webs Group Copyright © 2001-2010 All Rights Reserved
Privacy and Legal