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




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-12-2004, 11:06 PM
Sewdn Sewdn is offline
Registered User
 
Join Date: Jul 2004
Location: Belgium
Posts: 27
Rep Power: 0
Sewdn is on a distinguished road
is casting possible in AS2?

Hi,

I have yet another problem with the attachMovie() method. I made some classes extending from the MovieClip class. Whenever i try to attach an instance of this class to another MC, the typing of the function requires i use the MovieClip class as return type...

Say I have the class MyClass extending from MovieClip.
How to attach a MyClass instance?

I think there are 2 possibilities:

Actionscript:
var newObj:MyClass;
newObj = this.attachMovie("MyClass",lvl);

Actionscript:
var i:Number = 0;
var newObj:MyClass;
var name:String = "nameOfObj" + i++;
this.attachMovie("MyClass",name,lvl);
newObj = eval('this.'+name);

neither of them seems to work properly... can someone tell me what I'm doing wrong?

Casting might bring a sollution, but I doubt that's possible in AS2...

Thanks, Sewdn
Reply With Quote
 


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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CS3 and AS2: Embedding an external swf file deshg Newbies 2 11-11-2009 04:40 AM
[JOB] Senior AS2 Developer - Telecommute | 80-110k OSS Work/Job Opportunities 0 08-26-2008 11:12 PM
Difference between Flash Player 8 & 9 for AS2 movie ? Ultra Flash CS3 / Flash 9 1 10-02-2007 06:49 AM
AS2 working in Flash Player 6 but not Player 7+ Beany Actionscript 2.0 6 07-19-2007 06:39 PM
AS2 and script created MC's FrozenMedia Flash MX 2004 6 01-10-2004 02:05 PM




All times are GMT. The time now is 11:29 AM.