Flash Actionscripting Tutorial!
3 posters
Page 1 of 1
Flash Actionscripting Tutorial!
Hey Guys! 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).
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:
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!
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.
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:
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.
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.
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:
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.
A flash digital clock tutorial from ale632007
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!
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).
______________________________________________________________________________
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!
______________________________________________________________________________
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.
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.
______________________________________________________________________________
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.
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.
______________________________________________________________________________
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.
ii Set up your page.
iii Now its time to insert a symbol:
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.
v You have to insert layers.
This is a layer:
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:
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:
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: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.
- 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;
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:Now before testing your movie go to Scene 1 and in the library which you open it by pressing F11 or window>library
- Code:
gotoAndPlay(1);
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!!!!
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!
Last edited by nickdagamer on Fri Feb 22, 2008 7:21 am; edited 3 times in total
ale632007- ケrojects Admin
- Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada
ale632007- ケrojects Admin
- Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada
Re: Flash Actionscripting Tutorial!
ok tanks for makeing itnickdagamer wrote:made PSP Themes/Wallpapers section! plz do post
ale632007- ケrojects Admin
- Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada
Re: Flash Actionscripting Tutorial!
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!
ale632007- ケrojects Admin
- Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada
Re: Flash Actionscripting Tutorial!
lol indeed
ale632007- ケrojects Admin
- Posts : 541
Join date : 2008-02-18
Location : Ontario,Canada
Similar topics
» Apple PSP Flash
» [TUTORIAL] Get CFW on any PSP!!!!
» TUTORIAL FOR SPAM??
» [TUTORIAL] How to spam!!!
» [TUTORIAL] Get CFW on any PSP!!!!
» TUTORIAL FOR SPAM??
» [TUTORIAL] How to spam!!!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum