Placing a clip on stage at runtime

This is a discussion on Placing a clip on stage at runtime within the Macromedia Flash forums in Adobe Tools category; Hi, I have a movie clip in library i named bleu, with linkage identifier bleu. I want to place it on stage at runtime using AS 2.0, here is the code i type: var depth:Number = 1000; _root.attachMovie("bleu", "bleu_mc", depth); bleu_mc._x = bleu_mc._y = 0; Flash gives me error message: "Statement must appear within on/onClipEvent handler" This Three times on each of the three lines of codes. What am i doing wrong? What should i type? Thanks for helping...

Go Back   Application Development Forum > Adobe Tools > Macromedia Flash

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 10:21 PM
evrardBlom
Guest
 
Default Placing a clip on stage at runtime

Hi,

I have a movie clip in library i named bleu, with linkage identifier bleu. I
want to place it on stage at runtime using AS 2.0, here is the code i type:

var depth:Number = 1000;
_root.attachMovie("bleu", "bleu_mc", depth);
bleu_mc._x = bleu_mc._y = 0;

Flash gives me error message:

"Statement must appear within on/onClipEvent handler"

This Three times on each of the three lines of codes.

What am i doing wrong? What should i type?

Thanks for helping



Reply With Quote
  #2  
Old 08-26-2008, 10:42 PM
evrardBlom
Guest
 
Default Re: Placing a clip on stage at runtime

Quick additional information: it just appears as if any movieclip control
command i type in AS panel, flash CS3 gives same error message! Imagine this
time i put the clip directly manually on stage, gave it an instance name and
just put the code:

bleu_mc._x = bleu_mc._y = 0;

Same error message!!

Reply With Quote
  #3  
Old 08-27-2008, 10:16 AM
DMennenoh **AdobeCommunityExpert**
Guest
 
Default Re: Placing a clip on stage at runtime

Where is your code? The code is fine... but it needs to be on the main
timeline.

--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Reply With Quote
  #4  
Old 08-27-2008, 06:34 PM
evrardBlom
Guest
 
Default Re: Placing a clip on stage at runtime

Hello Dave,

The code is indeed on main timeline...
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:20 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.