
Welcome Guest
|
|
|
#1
|
||||
|
||||
|
assigning action script to not-yet-used MC
I'm trying to assign some action script to a MC that is only part of the .swf file if it gets called and attached. otherwise it never is used. How do I attach Action Script to this MC? I've tried dragging it into the timeline, typing the action script and then deleting the MC, but that erases the Action Script that I tied to the MC. Anybody know what I need to do? Thanks,
-J. |
|
#2
|
||||
|
||||
|
Hi Divis,
So, what you have is your _root timeline, a holder MC, and your attached MC. Once your MC is attached, you can reference it from the _root timeline using something like: Actionscript:
on (release) {
holderMC.attachedMC.gotoAndPlay(2);
} |
|
#3
|
||||
|
||||
|
no holder
here's the deal, I have a UFO that turns into a cursor on rollover, when you click, the UFO beams downa green light. This green light is the movie that I am having trouble attaching Action scripts too. Do I just need to add the action scripts to the first frame of the beam (green light) MC?
|
|
#4
|
||||
|
||||
|
Hey Divis,
I'm attaching a tweaked version of your file (sorry for the wait). All you have to do is : 1) go into your library, double-click to edit the MC "beam" 2) give your MC an instance name (in my example, I named it "beam" 3) Then all you have to do is assign actions to the frame or the movie clip itself. In my example I gave it frame actions that changed the color of the beam from green to red, using only actionscript. You could also directly assign the MC an onClipEvent action: Sloppy Example: Actionscript:
onClipEvent (enterFrame) {
actions;
}
|
|
#5
|
||||
|
||||
|
Germster,
Thank-you for the little lesson in Action Scripting! I have finished the file and will post it here for you to try out. Any suggestions of how to cut down the file size from 16 to 15 KB would be appreciated as I would like to use this as my signature. -J. |
|
#6
|
||||
|
||||
|
Hey again Divis,
I really like the effect that the beam makes .... beaming up the letters, pretty cool! Anyway, to cut the file size back, the only thing that I could think to do would be to remove the ball5 from the UFO MC. When I view the .swf, I can't seem to see the ball5 at all and it seems that it may be insignificant. If not, then let me know. I removed this and it cut the file size down from 16 kb to 13 kb. I hope this helps. ... I hope that they get the sigs working again on this site so you can use yours.
|
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help Modifying Action Script 2 | macrat1010 | Newbies |
1 | 03-08-2011 07:40 AM |
| Motion Tween + Action Script - Don't they work together | Patty5 | Newbies |
4 | 10-01-2008 12:39 PM |
| NEED HELP - Action Script 2.0 and CS3 timeline questions | snake_eyes_wolf | Newbies |
5 | 12-17-2007 09:42 PM |
| Scanning a .fla file for Action Script ? | Ultra | Flash 8 |
1 | 06-23-2007 02:05 PM |
| Action script in Flash 2004 | younger90 | Flash MX 2004 |
0 | 03-31-2005 09:17 PM |

Anyway, to cut the file size back, the only thing that I could think to do would be to remove the ball5 from the UFO MC. When I view the .swf, I can't seem to see the ball5 at all and it seems that it may be insignificant. If not, then let me know. I removed this and it cut the file size down from 16 kb to 13 kb. I hope this helps. 
