Flash Error #1009: Get On the....Stage!

Greetings and Salutations Everyone!

Can someone please help me resolve this issue I keep getting the same error("TypeError: Error #1009: Cannot access a property or method of a null object reference.
at FullFla$iinit()")
-I gather that I am attempting to call an object that is not presently on the stage, BUT I am unclear exactly what steps to take to correct it...Add a wrapper DisplayObject or do I change an the Event that I am listening for Please give me some guidance. I appreciate it immensely.

package {

import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.Loader;

public class FullFla extends Sprite {
private var _loading:Loading;
private var _navi:Navi;
private var menuList:Array = ["home", "about", "work"];

private var _menus:Array = new Array();
private var _pages:Array = new Array();
private var _urlNo:uint = 0;
private var _currentMenu:MovieClip;
private var _currentPage:Sprite;

public function FullFla() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

_loading = new Loading();
_navi = new Navi();

for (var i:int=0; i < menuList.length; i++) {
var mc:MovieClip = _navi[menuList[i]];
mc.redpoint.visible = false;

stage.addEventListener(Event.RESIZE, resizeHandler);


private function loadSwf():void {
var url:String = menuList[_urlNo] + ".swf";
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, completeHandler);
var req:URLRequest = new URLRequest(url);

private function completeHandler(e:Event):void {
if(_urlNo < menuList.length - 1 ) {
else {
_loading = null;

private function startPage():void {

for (var i:int = 0; i < _menus.length; i++ ) {
var mc:MovieClip = _menus[i]; = _pages[i];
mc.buttonMode = true;
mc.addEventListener(MouseEvent.CLICK, clickHandler);
_currentMenu = _menus[0];


private function displayPage():void {
_currentMenu.redpoint.visible = true;
_currentPage =;

private function clickHandler(e:MouseEvent): void {
_currentMenu.redpoint.visible = false;
_currentMenu = as MovieClip;

private function resizeHandler(e:Event = null):void {
var w:Number = stage.stageWidth;
var h:Number = stage.stageHeight;

if (Boolean(_loading)) {
_loading.x = w / 2;
_loading.y = h / 2;

_navi.y = h; = w;
_navi.logo.x = w - 10;

if(Boolean(_currentPage)) {
_currentPage.x = w / 2;
_currentPage.y = h / 2;

Posted On: Thursday 25th of October 2012 09:44:36 PM Total Views:  353
View Complete with Replies

Related Messages:

Editing flash application text content. Best way?   (245 Views)
, I'm creating a Flash presentation, and the user wants to be able to change the text on any screen from Flash itself. This was my original my idea (I don't have much experience in AS): 1 - Put all the text in a text file (XML or plain). 2 - Make AS read the text and fill in the text fields in the Flash presentation. 3 - When it's needed to change the text content, execute the Flash presentation with a parameter that will tell AS to show all the fields as INPUT. 4 - Save the new text in the text file via PHP. But I have been asked if it would be possible to avoid the use of a text file (and the server connection with PHP) and change the swf text content directly with AS. Is this possible I have been googling it but with no success. I have the idea that this wouldn't be possible but i don't know all the possibilites in the Flash environment.
build a scroll bar by action script in flash   (237 Views)
I would like to produce a fitting room system, and the users can adjust doll's size. In terms of shoulder, hip, and the length of both legs and arms by a horizontal scroll bar in this system. How could I control Action Script by Flash Please kindly share your experiences and opinions with us,
Linking external SWFs to the main flash file, Error 1120   (208 Views)
Please can someone help me with fixing this problem: I have made a menu bar and linked each separate swf file to the corresponding button. Upon testing my main movie, all the text on the main page is disappearing, the new swf file is not loading and the message 1120 error appears for all my buttons. I have checked the instance names and they match along with publish settings and folder settings. I cant understand why its not working Hope someone can help. Error: Scene 1, Layer 'Actions', Frame 1, Line 25 1120: Access of undefined property portfolio_btn. Code: var Xpos:Number = 180; var Ypos:Number = 200; var swf:MovieClip; var loader:Loader = new Loader(); var defaultSWF:URLRequest = new URLRequest("swfs/biography.swf"); loader.load(defaultSWF); loader.x = Xpos; loader.y = Ypos; addChild(loader); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Btns Universal function function btnClick(event:MouseEvent):void { removeChild(loader); var newSWFRequest:URLRequest = new URLRequest("swfs/" + + ".swf"); loader.load(newSWFRequest); loader.x = Xpos; loader.y = Ypos; addChild(loader); } // Btn listeners Biography_btn.addEventListener(MouseEvent.CLICK,bt nClick); portfolio_btn.addEventListener(MouseEvent.CLICK, btnClick); news_btn.addEventListener(MouseEvent.CLICK,btnClic k); gallery_btn.addEventListener(MouseEvent.CLICK,btnC lick); merchandise_btn.addEventListener(MouseEvent.CLICK, btnClick);
can I use mx.core.UIcomponent in flash   (191 Views)
I know it is intended for flex ... but what does that mean ... can I use it in flash ... if not, why not ... but more importantly: all of the mx classes, spark classes, flashx classes ... why are they NOT for flash pixels are pixels, matrices are matrices, 0's are 0's, 1's are 1's.
Limit flash loop to 30s   (189 Views)
actionscript users, I have a flash banner exactly like this one on a continuous loop. Does anyone know how can I stop the loop at the 30s mark That's one of the adwords requirements for flash banners. Thank you.
redirect browser from flash amfphp   (218 Views)
, I am currently developing an application in flash. In this application user will be able to buy in-game currency using real life money. For this purpose we have some external actors. In our case, it is hipay. Now, once a user clicks on a particular button, as3 will use amfphp to call a php file that eventually will do this: header("Location: ".$url) ; Once this happens I get an error in my flash: Error: Request for resource at by requestor from denied due to lack of policy file permissions Connection to halted not permitted from *** Security Sandbo Violation *** Warning: failed to load policyfile from Now, is this a problem on my side or hipay's side. If it is the latter I'm screwed I guess and have to find another solution. Can anyone help me with this
Help creating a flash slideshow galary to show videos   (214 Views)
I am relatively new at using flash but need to create a flash slideshow galary to show videos. I found the link below and it is exactly how I want it to be shown and created. If anyone has any ideas of where I need to start to get this implemented I will be extremely grateful. Many
I need flash canvas menu ...   (259 Views)
.. I need an flash canvas menu, written in AS3... In any shape, any type, it doesn't matter... Please help...
flash chart   (246 Views)
hi , can any one tell, how to develop flash charts (eg. pie charts) only with as3 and without using any components
mouse cursor changes in flash apps   (217 Views)
i have a flash loader thats loads many flash swf games, the problem is that the mouse corsair turns to the game's corsair and we trying to keep our original corsair. help will be appreciated.
flash projector files and multiple swfs?   (168 Views)
I have a project with many swf files loading dynamically. When I export my .app projector file only the main swf appears. Can you project multiple swf files into a .app or .exe file do the swf files have to be within same directory of the projector files any help would be appreciated.
Flash how to ipad flash app save data   (152 Views)
I'm planning to build an ipad flash game and would like to save some information, like user info like name and unlocked levels. How can i do that
How can I make my flash website to view it in FULL SCREEN MODE?   (263 Views)
How can I make my flash website to view it in FULL SCREEN MODE as in the following website Please do help.
passing keystrokes from air browser to flash game   (207 Views)
Here's my situation - I am accessing some games that my company built using a AIR browser (allowing us to sell an installable product on a CD, but keeping the content online for ease of maintenance). I can get the games to load, but i cant get them to accept keystrokes, ie: we have a tetris-like game that isnt getting any of the arrow key inputs. I'm fairly certain this has something to do with a focus issue, but I have no idea how to fix it. Any suggestions would be welcome.
Can flash load in SWCs at runtime?   (170 Views)
Beginners Intro to SWC files SWCs are ZIP archives with two files in them: catalog.xml - Lists all classes contained in the SWC along with their dependencies.library.swf - Contains all the actual classes So theoretically... It should be possible to load in SWC files at run time and use the classes from them, right You may have to unzip it first and extract out the SWF, but this arduous process could be made easier with a few helper classes. In fact, having the "catalog.xml" there may also make it easier to identify which classes are contained within (which means you don't need to guess or assume which classes are in it). Has anyone tried this yet or know of anyone else who has I searched Google for a bit, but most results actually were actually mislabeled, and loading the SWC in at compile time. I found nothing relevant, so asking here is much easier.
Help Me! - Imbedded a SWF file into flash but doesn't go away when you click out   (193 Views)
, I have inserted a scrolling gallery into my website but now whenever I click on the portfolio section that brings up the gallery I can't click out. The buttons are still there, but whenever you click another button it overlays the text and other images I put in them overtop the gallery scroll. How do I get this galleryscroll to stop being an attention-addict! Code for buttons - stop(); function goHome (e:MouseEvent):void{ gotoAndStop("Home"); } home_btn.addEventListener(MouseEvent.CLICK, goHome); function goAbout (e:MouseEvent):void{ gotoAndStop("About"); } about_btn.addEventListener(MouseEvent.CLICK, goAbout); function goLinks (e:MouseEvent):void{ gotoAndStop("Links"); } links_btn.addEventListener(MouseEvent.CLICK, goLinks); function goContact (e:MouseEvent):void{ gotoAndStop("Contact"); } contact_btn.addEventListener(MouseEvent.CLICK, goContact); code to bring scroll in - stop(); var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest = new URLRequest("galleryscroll.swf"); myLoader.load(url); code of the gallery scroll herself - import mx.transitions.Tween; import mx.transitions.easing.*; this.createEmptyMovieClip("container",1); var imagesNumber:Number = 6; var scrolling:Boolean = true; for (i=1; i0) { this._x = 0; } if (-this._x>(this._width-Stage.width)) { this._x = -(this._width-Stage.width); } }; for (i=1; i
Photo template in flash 3   (192 Views)
! this is the actionscript of a photo template that i found in Flash 3. The problem is that I've tried to copy the frames to another flash file and now it doesn;t work propeply. These are the errors: 1023: Incompatible override. 1021: Duplicate function definition. I'm a beginner and dont know how to fix shall i do it function updateFrame (inc) { // send slides to new frame newFrame = _root._currentFrame + inc; _root.gotoAndStop(newFrame); updateStatus(); if (_root._currentFrame == 1) { prevBtn.gotoAndStop(2); } else { prevBtn.gotoAndStop(1); } if (_root._currentFrame == _root._totalFrames) { nextBtn.gotoAndStop(2); } else { nextBtn.gotoAndStop(1); } } function updateStatus () { _root.statusField = _root._currentFrame + " of " + _root._totalFrames; } function autoplayInit () { startTime = getTimer(); hideControls(); updateStatus(); } function autoplay () { if (autoplayStatus != 0) { // get the current time and elapsed time curTime = getTimer(); elapsedTime = curTime-startTime; // update timer indicator indicatorFrame = int(4/(delay/(elapsedTime/1000))); indicator.gotoAndStop(indicatorFrame+1); // if delay time if met, goto next photo if (elapsedTime >= (delay*1000)) { if (_root._currentframe == _root._totalframes) { _root.gotoAndStop(1); } else { _root.nextFrame(); } autoplayInit(); } } } function hideControls () { nextBtn.gotoAndStop(2); prevBtn.gotoAndStop(2); } updateFrame(); autoplayStatus = 0;
Flash flash cs3 list box, look and feel urgently required   (193 Views)
Friends, I need a small help from you . I want to display a list box in a diferent way. I have uploaded the image as well ie what exactly am looking for and how the list box has to look. pls refer my attachment. i am parsing the xml data and it's coming fine in list box. but my reqmnt is the look n feel of list box, can u pls help me out. flash code : var xmlLoader:URLLoader = new URLLoader(); var xmlData:XML = new XML(); xmlLoader.addEventListener(Event.COMPLETE, LoadXML); xmlLoader.load(new URLRequest("news1.xml")); function LoadXML(e:Event):void { xmlData = new XML(; ParseNews(xmlData); } function ParseNews(xml:XML):void { var config:XMLList = xml.item.title; for each (var Title:XML in config) { my_lst.addItem({label:Title, data:Title}); } } xml data : Cameras PlP Add A Call Layout Participants waiting for your replies rajesh
cannot convert flash.display::Sprite   (228 Views)
cannot convert flash.display::Sprite@39394a9 to flash.display.MovieClip. here is sample code Code: var enemyArray:Array = new Array(); var mySprite:Sprite; mySprite = new Sprite(); addChild(mySprite); var myEnemy:Enemy; myEnemy = new Enemy(); mySprite.addChild(myEnemy); enemyArray.push(myEnemy); removeEnemy(e:Enemy) { for(var i in enemyArray) { if(enemyArray[i] == e) { enemyArray.splice(1,i); } } } enemy class: if anemy is offscreen he will call the deleteEnemy then it will delete the enemy from stage after that it will call removeChild() from the parent to remove the enemy from the array Code: deleteEnemy() { MovieClip(parent).removeEnemy(this); parent.removeChild(this); } then it will get the error above i guess the problem is, enemy class cant access the removeEnemy() in parent class but when i remove the sprite like this: Code: addChild(myEnemy); rather than this: Code: mySprite.addChild(myEnemy); then it will be ok, but my goal is, How can enemy call the removeEnemy() in parent while it is inside the sprite, tnx for the help in advance...
Calling the flash application with javascript for batch processing?   (192 Views)
boys and girls. I'm working on a cartoon series in the uk and we use flash, 3d and after effects. I'm building a little pipeline tool to help us compositors do your job (there's hundreds if not thousands of files to be comped for a great number of shows) anyhow, we use flash for the 2d animation and we need to extract pngs. Right now it's a process I can't streamline (ie compers still have to have flash opened to choose which layers to export manually) but I'd like to be able to open flash and launch a specific javascript file ('command') this is not AS3-related but does anyone of you know how to do this