Would you like to react to this message? Create an account in a few clicks or log in to continue.

Flash Actionscripting Tutorial!

3 posters

Go down

Flash Actionscripting Tutorial! Empty Flash Actionscripting Tutorial!

Post by nickdagamer Mon Feb 18, 2008 12:36 pm

Hey Guys! happy I've seen a few posts in which people need some help in flash! Well here is your chance to learn how to do it!

Note: You need to have basic knowledge in Flash (Flash 6 or above)!
______________________________________________________________________________


Tutorial: (Convert an image/object to a movie clip)

1)Import an image by File>Import>Import to library.

2)Select the image/object and right click. Then in the drop down menu, select the option Convert to Symbol.

3)You will see a pop-up screen like in the image. Select Movie Clip and click Ok. (You could also make it a button/graphic, but a movie clip is more flexible).

Flash Actionscripting Tutorial! Symbiq7

______________________________________________________________________________


Tutorial: Drag and Drop

1)Note: You can only drag a movie clip!

2)Select the movie clip you want to drag. Then press F9 or open up the actions panel.

3)Then paste the following code in the actions panel:
Code:
on (press) {

    //Start Dragging Movieclip Behavior
    startDrag(this);
    //End Behavior

}
on (release) {

    //Stop Dragging Movieclip Behavior
    stopDrag();
    //End Behavior

}

This simulates a normal drag and drop feature like in windows. So, "onPress", you drag the movie clip and then "onRelease", you stop dragging the movie clip.

Now coming to Hiding/Showing a movieclip! happy

______________________________________________________________________________


Tutorial: Hiding a movie clip


1)Note: You can only hide/show a movieclip.

2)First make a button which will either hide/show the movie clip.

3)Select a movieclip you want to hide. You will see a box like this at the bottom. If you don't then go to Window>Properties.

Flash Actionscripting Tutorial! Boxes9


4)Now where you see the word , type in example.

5)Then, select the button and open up the actions panel by pressing F9.

6)Paste the following code:
Code:
on (press) {

    //Hide video Behavior
    this.example._visible = false;
    //"example" represents the name of the movieclip that you are hiding.
}

So what we just did is hide a movie clip with the instance name of "example". So, if u want to hide another movieclip, with another instance name the just replace "example" with the new instance name. wink

______________________________________________________________________________


Tutorial: Show a movie clip

1)Note: You can only hide/show a movieclip.

2)First make a button which will either hide/show the movie clip.

3)Select a movieclip you want to show. You will see a box like this at the bottom. If you don't then go to Window>Properties.

Flash Actionscripting Tutorial! Boxes9


4)Now where you see the word , type in example.

5)Then, select the button and open up the actions panel by pressing F9.

6)Paste the following code:
Code:
on (press) {

    //Hide video Behavior
    this.example._visible = true;
    //"example" represents the name of the movieclip that you are hiding.
}

So what we just did is show a movie clip with the instance name of "example". So, if u want to hide another movieclip, with another instance name the just replace "example" with the new instance name. wink

______________________________________________________________________________


A flash digital clock tutorial from ale632007


A lot of people asked me how i do the digital clock and I'm gonna post it here for the other who doesn't know how to create it. ;D


i Open the flash program and in the welcome screen select Flash Document or New Flash Document.
Flash Actionscripting Tutorial! Welcomepg5
ii Set up your page.
Flash Actionscripting Tutorial! Pagesettingsfo7
iii Now its time to insert a symbol:
Flash Actionscripting Tutorial! Symbolxg2
iv from there you have to give a name which is gonna be "clock_mc" and what type you want to be , you want a Movie clip so you select the movieclip option then press ok.

Flash Actionscripting Tutorial! Movieclipzn3


v You have to insert layers.
This is a layer:
Flash Actionscripting Tutorial! Layerjo3
To insert a layer right click on the actual one or beside it an select Insert Layer. YOU DON'T HAVE TO RENAME THEM!!! but anyway to rename them just doubleclick on them then type whatever you want.
You must have 3 layers:
1.background
2.clock
3.actions
Now the box with layers should look like this:
Flash Actionscripting Tutorial! Layerslt5
vi Now you have all the layers, find where is the layer named clock and there you press on it.
then in the design space using the text tool you create a Dynamic text.How?
Fist you draw a box using the text tool and then in the properties panel where it says static text from the drop menu you have to select dynamic text ,then in the box where it says you type in clock_txt.
It should look something like this:
Flash Actionscripting Tutorial! Textsd6
Flash Actionscripting Tutorial! Propertiesuf0
vii Your almost done,before everything you have to add some script.
Now in the layers panel ,you press on actions layer and then in the actions panel wich you open with F9 or from window>actions
you type the following code:
Code:
time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12;
}
if(hours<10)
{
hours = "0" + hours;
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
clock_txt.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;
ok now your ready to insert some frames.To do so there beside the layer its a box with a dot right click on it and select insert keyframe not frame.YOU HAVE TO INSERT KEYFRAMES FOR EVERY LAYER IN THIS CASE.
viii After that, you close the action panel and you have to insert another keyframe for every layer.
In the second keyframe from actions layer you open again action panel and type the following code:
Code:
gotoAndPlay(1);
Now before testing your movie go to Scene 1 and in the library which you open it by pressing F11 or window>library
There in the new panel which just opened you should see the clock_mc press on it and drag it in Scene 1.
Then your ready to test your movie by pressing Ctrl+Enter.

Hope it helped!!!! happy



If your unsure about this use the source code wich you can download here:

http://www.sendspace.com/file/yqux7p



Right Click Tutorial By: ale632007

Paste this code in the movie clip!

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 1;
}
on(keyPress "") {
endX = _root._xmouse;
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

Hope this helped! happy


Last edited by nickdagamer on Fri Feb 22, 2008 7:21 am; edited 3 times in total
nickdagamer
nickdagamer
ケrojects Admin
ケrojects Admin

Posts : 226
Join date : 2008-02-17

https://nickdagamer.forumakers.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by ale632007 Mon Feb 18, 2008 12:39 pm

cool
ale632007
ale632007
ケrojects Admin
ケrojects Admin

Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by nickdagamer Mon Feb 18, 2008 12:40 pm

lol!
nickdagamer
nickdagamer
ケrojects Admin
ケrojects Admin

Posts : 226
Join date : 2008-02-17

https://nickdagamer.forumakers.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by ale632007 Mon Feb 18, 2008 12:40 pm

yup
ale632007
ale632007
ケrojects Admin
ケrojects Admin

Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by nickdagamer Mon Feb 18, 2008 12:43 pm

made PSP Themes/Wallpapers section! plz do post
nickdagamer
nickdagamer
ケrojects Admin
ケrojects Admin

Posts : 226
Join date : 2008-02-17

https://nickdagamer.forumakers.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by ale632007 Mon Feb 18, 2008 12:46 pm

nickdagamer wrote:made PSP Themes/Wallpapers section! plz do post
ok tanks for makeing it
ale632007
ale632007
ケrojects Admin
ケrojects Admin

Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by DPK Tue Feb 19, 2008 9:44 am

fixed your first code box happy
DPK
DPK
ケrojects Mod
ケrojects Mod

Posts : 36
Join date : 2008-02-19
Age : 30
Location : West London

http://dkwebdesigns.webs.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by nickdagamer Tue Feb 19, 2008 9:49 am

thanks! hope this helped! i use the drag for icons! and hide/show for hiding and showing movieclips! this show the window and hides it! simple!
nickdagamer
nickdagamer
ケrojects Admin
ケrojects Admin

Posts : 226
Join date : 2008-02-17

https://nickdagamer.forumakers.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by DPK Thu Feb 21, 2008 4:17 am

yeah !! you pwn @ flash !! smile
DPK
DPK
ケrojects Mod
ケrojects Mod

Posts : 36
Join date : 2008-02-19
Age : 30
Location : West London

http://dkwebdesigns.webs.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by ale632007 Fri Feb 22, 2008 5:13 am

indeed
ale632007
ale632007
ケrojects Admin
ケrojects Admin

Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by nickdagamer Fri Feb 22, 2008 7:05 am

lol!
nickdagamer
nickdagamer
ケrojects Admin
ケrojects Admin

Posts : 226
Join date : 2008-02-17

https://nickdagamer.forumakers.com

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by ale632007 Fri Feb 22, 2008 7:34 am

lol indeed
ale632007
ale632007
ケrojects Admin
ケrojects Admin

Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada

Back to top Go down

Flash Actionscripting Tutorial! Empty Re: Flash Actionscripting Tutorial!

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum