|
| ||||||||||
| Tags: actionscript, as3, flash scripting, scripting langauge |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| ActionScript 3 beginner having problem
Code: var sp:Sprite=new mc(); sp.name="sp1"; sp.life=100; // Error: Access to the property life can not be defined via a reference type static... this.addChild(sp); |
|
#2
| ||||
| ||||
| Re: ActionScript 3 beginner having problem
you already type your object into another, even if it is extended it is cleaner type in the class var sp:Sprite = new Sprite(); var sp:mc = new mc(); well then you have property in your life object mc?
__________________ Grand Theft Auto 4 PC Video Game |
|
#3
| |||
| |||
| Re: ActionScript 3 beginner having problem
These 2 lines together does not work, only the 2nd password. How does it if the life and property is in my object mc? TM is a clip (actually a class with export for actionscript checked). In AS2 you could add in the script as variable they wanted to be attached when a clip on the stage, eg after a mc = attachMovie (....) mc.life6; mc.energy = 100; etc. ... there was nothing else to do. |
|
#4
| ||||
| ||||
| Re: ActionScript 3 beginner having problem
And yes but you must have now created an object or class var obj:object = new Object() obj.clip = new mc(); obj.energy = 100 addChild(obj.clip)
__________________ Grand Theft Auto 4 PC Video Game |
|
#5
| |||
| |||
| Re: ActionScript 3 beginner having problem
Well, AS3 messes up everything! Fun all these tips, I'll try it myself and document over because finally there's a lot more changes than I thought. Actually it might work as AS2 is typing when that all happens. Code: var sp:mc=new mc(); //While with var sp:Sprite=new mc()... addChild(sp); sp.life=10; //... this line would not work |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "ActionScript 3 beginner having problem" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to convert Actionscript 2 to actionscript 3 | Bol-Bacchan | Software Development | 4 | 17-01-2011 06:59 AM |
| Is it possible to write ActionScript 2 in Adobe CS5 | B-JOB Guru | Windows Software | 3 | 16-01-2011 05:09 AM |
| Want to learn ActionScript.....What to Refer? | Andrzej | Software Development | 3 | 14-11-2009 11:12 AM |
| ActionScript in Flash CS3 | Manthan | Software Development | 4 | 08-07-2009 10:18 PM |
| Actionscript 3 Compiler ? | Xavier1234 | Software Development | 3 | 29-06-2009 05:09 PM |