I have just started learning AS3.0 but I used AS2.0 for a while.
I am just trying to add movie clips from the library and the script I have in the function works fine on the time line but when I put it the class it no longer works or at least I dont think it gets added to the display list but it doesnt show.
Here is my code I think it could be to do with the classes imported at the top of the class.
package com{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.*;
import flash.display.*;
import flash.text.TextField;
import flash.net.*;
public class gallery extends MovieClip {
//public var gfx:Stephen = new Stephen();
public function gallery(mainArray) {
Main();
init(mainArray);
}
public function init(mainArray) {
createFirstLevelMenu(mainArray);
}//
public function Main() {
var test:Test = new Test();
addChild(test);
}
public function createFirstLevelMenu(mainArray) {
var container:MovieClip = new MovieClip();
addChild(container);
var gfx:Stephen=new Stephen(); //Stephen is a symbol in the library and has the same instance name
container.addChild(gfx);
trace(this.numChildren);//traces 1
}
}
it definitely calls the class and the function.
I am completely stuck any help would be appreciated.
Many thanks
Stephen