Web Design Talks
website design tips and tricks

Button to Music Swith ON/OFF

June 22, 2008 21:54 by anjel

Create new clip for sounds:

  1. Create 3 main frames
  2. Add action stop() in every frame
  3. Insert music in the first frame
  4. Insert gotoAndStop(1);  in the second frame
  5. Insert gotoAndPlay(1);  in the third frame

Create Button:

  1. Create 2 main frames
  2. Add action stop() in every frame
  3. Insert OFF button in the first frame
  4. Insert actions in the OFF button:
  • on (release) {
    tellTarget ("../music") {
    stopAllSounds();
    }
    }
    on (release) {
    nextFrame();
    }

Insert ON button in the first frame and the action script:

on (release) {
tellTarget ("../music") {
nextFrame();
}
}
on (release) {
prevFrame();
}

Now place clip with music on the first scene and name it music in instance panel. 

Place the button on the main scene.

Press Ctrl+Enter


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Delay by Mouse Click

June 2, 2008 20:14 by anjel

This tutorial will show you the basis of deceleration. Your object will be moved to that place where you have clicked. You can download .fla file here slide2mouse_partial.fla (24.50 kb)

1. Create a new file. The size of scene is not so important.

2. On the main scene draw a circle and make a movie clip.

3. To do this press F8 and select Movie clip, then name it on your choice.

4. Now click over the clip by right mouse and select Actions. Insert the following code into Action's window:

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

Now you can run the clip by pressing CTRL+Enter.  That's it.

 

 


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Random Movement In Flash - Flash Tutorial

May 26, 2008 21:49 by anjel

Create a new file of 550x100 size and make Frame rate 30 frames per second. Draw vertical line the same as vertical size of our clip.

 



Now select that linke and press F8 to get it into movie clip.  The name of the clip is not is not important. Now we have  a movie clip containing our line.



Now select the movie clip and press F9, now you are inside ActionScript. Please make sure that the selection is on movie clip exactly! Now insert the following code:

 

onClipEvent (enterFrame) {
_x = random(551);
_alpha = random(101);
}

 

That is it! Now go to Control > Test Movie or simply press Ctrl+Enter.  

You should get a saltatory line over image like this one:

   


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Simple Flash Pre-Loader

February 11, 2008 22:51 by anjel

Draw a rectangular without boundary lines. Open panel Color Mixer. Click on a rectangular in panel Color Mixer and choose linear from the dropping out menu. Create a gradient that your rectangular has been painted over here as shown below:

 

Make rectangular MovieClip, having chosen it and having pressed F8. Name it "bar", and type choose Graphic. Create a new clip, having pressed Ctrl+F8. Name it "preloader_mc", and type choose movie clip. Draw a zigzag in the first frame. Then pass to 90-th and press F5.

 

Create a new layer and place it before the first. Insert a graphic symbol "bar" into this new layer. Make so that the rectangular was a little above a zigzag. Arrange a rectangular thus:

 

Pass on 35th frame and press F6. In the frame drag a rectangular on other party from a zigzag:  

 

No do the following:

- Go to any frame between the first and 35-th, click with the right button, from the menu choose Create motion tween.
- Go on 40th frame and make its main (F6).
- Inside the frame choose a rectangular and develop it. Modify> Transform> Flip Horizontal.
- Go on 85th frame and make its key (F6).
- Inside this frame choose a rectangular and turn it how it was in the first frame.
- Pass to any frame between 41 and 84, click with the right button, from the menu choose Create motion tween.
- Pass on 90th frame and press F5.

 

Insert preloader into the first stage:


- Go to the first stage.
- Create 3 new layers.
- Drag a symbol "preloader_mc" from library on a stage. Press F5 in the second the staff.
- Write "Loading" in the first frame of the second layer.
- Copy this code in the first frame of the first layer.

 

  ifFrameLoaded ("end") {
  gotoAndPlay ("start");
  }

Press F6 in the second frame of the first layer and insert into action this code: 

  gotoAndPlay (1);

 

The basic clip begin with 3-rd frame. The first frame name start, and last end. 

That's it. Have a fun :) 


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5