How to use a symbol instance on the stage in an external package?
Hi All,
I am new to ActionScript and Flash. I am trying to develop a simple screen with a few symbols (button) and a youtube player(this part has already been taken care of- thanks to Ben Longoria's great class object).
I have a symbol called s1 in the library and I also created an instance of it on the stage on the first frame, its name is myS01
Before I linked the document to a class (this was for youtube player) I was able to add event listeners, such as mousevents, onto this instance in my actions panel. But, after I linked my document to the external class in a package without a name, I cannot add any code into Actions panel, because it gives me all kinds of weird problems.
Instead I am trying to use this symbol and add listeners to it in my external class file (the one linked to the document) with no luck.
my external class file looks like:
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import src.com.enefekt.tubeloc.MovieSprite;
import src.com.enefekt.tubeloc.event.*;
import fl.controls.Button;
/**
* Example class for MovieSprite class and the chromed player
* @7111211 Ben Longoria enefekt@gmail.com
*/
[SWF(backgroundColor="#FFFFFF")]
public class MainChromed extends Sprite {
private var youtubeMovie:MovieSprite;
public function MainChromed() {
youtubeMovie = new MovieSprite("NN2I1pWXjXI");
youtubeMovie.addEventListener(PlayerReadyEvent.PLAYER_READY, onPlayerReady);
youtubeMovie.x = 250;
youtubeMovie.y = 160;
addChild(youtubeMovie);
}
private function onPlayerReady(event_p:PlayerReadyEvent):void {
youtubeMovie.width = 320;
youtubeMovie.height = 240 + MovieSprite.CHROME_HEIGHT;
}
}
}
How would I use my myS01 instance of s1 in this .as file? I just want to be able to refer to it.
For example, I tried adding:
private var b:s1 = new s1(); right after the line private var youtubeMovie:MovieSprite;
,but got the following error:
1120: Access of undefined property b.
Any suggestions would be very helpful.
Thank you for your time in advance,
Pr@grammer