
Welcome Guest
|
#1
|
|||
|
|||
|
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 |
«
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 |
| 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 |

Programming Languages



