LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
  #1  
Old 06-20-2002, 06:47 PM
debonaireFlash's Avatar
debonaireFlash debonaireFlash is offline
Registered User
 
Join Date: May 2002
Location: KS - USA
Posts: 78
Rep Power: 12
debonaireFlash is on a distinguished road
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  
Old 06-20-2002, 07:12 PM
thegermster's Avatar
thegermster thegermster is offline
Registered User
 
Join Date: Feb 2002
Location: Richmond, VA USA
Posts: 116
Rep Power: 12
thegermster is on a distinguished road
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);
}
And to reference the root timeline from the attached movie, use the _parent._parent reference. If you want to directly assign AS to the MC, just open your library (Ctrl + L) and double click your MC. Is this what you are looking for?
__________________
-germ
variable limit
generation axis
kan pai
  #3  
Old 06-20-2002, 07:19 PM
debonaireFlash's Avatar
debonaireFlash debonaireFlash is offline
Registered User
 
Join Date: May 2002
Location: KS - USA
Posts: 78
Rep Power: 12
debonaireFlash is on a distinguished road
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  
Old 06-21-2002, 04:38 AM
thegermster's Avatar
thegermster thegermster is offline
Registered User
 
Join Date: Feb 2002
Location: Richmond, VA USA
Posts: 116
Rep Power: 12
thegermster is on a distinguished road
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;
}
I hope this helps you out. Let me know if you need something else. I'm glad to help.
__________________
-germ
variable limit
generation axis
kan pai
  #5  
Old 06-22-2002, 12:55 AM
debonaireFlash's Avatar
debonaireFlash debonaireFlash is offline
Registered User
 
Join Date: May 2002
Location: KS - USA
Posts: 78
Rep Power: 12
debonaireFlash is on a distinguished road
Big Grin Lesson in Action Scripting

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.
Attached Files
File Type: zip divis.zip (38.2 KB, 14 views)
  #6  
Old 06-22-2002, 03:01 AM
thegermster's Avatar
thegermster thegermster is offline
Registered User
 
Join Date: Feb 2002
Location: Richmond, VA USA
Posts: 116
Rep Power: 12
thegermster is on a distinguished road
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.
__________________
-germ
variable limit
generation axis
kan pai
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 03:03 AM.