News Box
WELCOME TO MLNO!!! ... ENJOY YOUR TIME HERE! ... WHILE YOU ARE HERE, CHECK OUT OUR RPGS!
My LEGO Nexus Organization
January 31, 2026, 09:29:38 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to My Lego Nexus Organization! A LEGO Universe, LEGO and My LEGO Network Fan Site! The LEGO Company does not sponsor, authorize, or endorse this site.-- New? Check out the welcome forum and get started! Got questions? PM Blade, or one of the other active members of the staff.
 
  Home   Forum   Help Arcade Gallery Rules Staff List Login Register Chat  

Computer 101

Pages: [1] 2   Go Down
  Print  
Author Topic: Computer 101  (Read 2317 times)
0 Members and 27 Guests are viewing this topic.
Obi
Outstanding MLNO Trader
Artisan
***

MLNO Reputation 2
Offline Offline

Gender: Male
Team: No Team
Purpose: Finish my awful college apps
Posts: 2735




Badges: (View All)
Eighth Year Anniversary Seventh Year Anniversary Level 6
« on: September 23, 2009, 08:21:01 pm »

O.K, I'm not sure if you have as3 or not, but I knew as2 at one point.... If you don't have as3, I'll figure it out (how to make it in as2). However, when I started learning as3, I forgot as2...

Anyway.... here's how to make it:

1. Create a new doc (as3)
2. Create the movieclips (lightsaber blade and lightsaber hilt)
3. Create 2 more layers  (to have 3 total)
4. On the first layer, put nothing (this is where the actionscript will be)
5. On the second layer, put the lightsaber hilt (instance name ls_handle)
6. On the last layer, put the lightsaber blade (instance name ls_blade)
7. Go to the actions layer (top layer. Make the layer name actions if you want, but keep in mind I will always refer to is as the actions layer)
8. Put in this code:

ls_handle.addEventListener(MouseEvent.MOUSE_DOWN, bladeOut);

function bladeOut(event:MouseEvent) {
      ls_blade.play();
}

ls_handle.buttonMode = true;

Now, here's what the code means:
1st line: This is creating the event listener (hence addEventListener). Putting ls_handle (the lightsaber hilt instance name) in front of it means, in this case (since it's a mouse event), that if you click on that (and only that), it will open and close the lightsaber hilt. And now, inside the ()'s. The event type is a mouse event (hence MouseEvent), and the event will be triggered when you click (hence .CLICK). The function name is bladeOut(hence bladeOut);
Line 3: This is creating the function bladeOut. You put the:
 (event:MouseEvent)

 in there to show that it is a mouse event, in case you have another event with the same name.
Line 4: This is triggering the animation (We haven't created it yet)
Line 5: This closes the event.
Step 9: Go inside the lightsaber movie clip, and create an animation of it going up and down. In the first frame, go into the actions panel, and type:

stop();

Type that in the 15th frame action panel as well.
Step 10: Done!

http://up2share.com/view/imfbwdgju
Report Spam   Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

LEGO® is a trademark of the LEGO Group, which does not sponsor, authorize or endorse this site.
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.053 seconds with 13 queries.