Actionscript 3.0 :: Preloader Error #1009 With Movie Class?

Dec 9, 2009

I am attempting to use a simple preloader that I've used many times in the past but am now receiving an error. The difference this time is that I've created a Class as opposed to just placing all of my code in the the time line. I've placed the following code in the timeline of my preloader movie and am attempting to load the SWF of my main movie, which uses an external class for all of its code.

ActionScript Code:
Code: Select allfunction loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;

[code]....

When I publish the file, I get the error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at game()

Everything runs perfectly fine when i publish the file not using any preloader.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Preloader Error 1009 With Movie Class

Dec 9, 2009

I am attempting to use a simple preloader that I've used many times in the past but am now receiving an error. The difference this time is that I've created a Class as opposed to just placing all of my code in the the time line.

[Code]....

When I publish the file, I get the error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at game() Everything runs perfectly fine when i publish the file not using any preloader.

View 1 Replies

ActionScript 3.0 :: Getting Error 1009 When Adding Preloader To Flash Movie

Aug 11, 2010

I'm trying to add a preloader to my flash movie so the user doesn't have to wait for additional frames to load while they are navigating. When I try to shift my current frames over by 2 frames to make room for the preloader I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at APIVisionDigitalRecall_fla::MainTimeline/frame3()[APIVisionDigitalRecall_fla.MainTimeline::frame3:20]
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at navBar()

Everything works fine before I shift the frames by 2, so I don't understand why I'm getting a complier error abut an object not existing. What to do to add a pre-loader to my existing movie without moving everything over by two frames?

I was planning on putting this code on frame 1:
ActionScript Code:
var kbtotal:Number=stage.loaderInfo.bytesTotal/1024;
var kbloaded:Number=stage.loaderInfo.bytesLoaded/1024;
var percent:Number= Math.round(kbloaded/kbtotal*100)
loader.gotoAndStop(Math.floor((precent/100)*100));
loader.loadingStatus.text=Math.round(kbloaded) + " lb / " + Math.round(kbtotal) + "kb";

This code on frame 2:
ActionScript Code:
if (kbloaded == kbtotal){
gotoAndPlay("Main");
} else{
gotoAndPlay("Load");
}

View 3 Replies

ActionScript 3.0 :: Preloader  #1009 Error?

May 5, 2010

I've been trying to load external swf ("index.swf") with the following code in AS3:

//it's a simple preloader with one dynamic text field: "percent"
//the "index.swf" is suppose to stop at 689 frame after being loaded (this part works fine)
stop();

[code].....

View 6 Replies

Actionscript 3.0 :: Preloader: Error #1009

Mar 9, 2009

i have a preloader.fla(swf) file; when loading is complete the Portfolio.fla(swf) displays.

The preloader.fla worked fine up until I attached a file called MyContent.as to the Portfolio.fla file. Now I'm getting an error message when I preview the preloader.fla that says:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MyContent/init()
at MyContent()

How do I correct this so the Portfolio.swf page displays?

[Code]...

View 1 Replies

ActionScript 3.0 :: 1009 Error After Putting The Preloader?

Jan 25, 2009

i've put simple preloader on frame 1. since then i get an 1009 error message. I debugged the file and it seems like it is referring to 'franklin_button' but this is the button on the stage. i've checked the instance name thousand times and it is correct name.

frame 1(preloader script)
stop();
this.loaderInfo.addEventListener(ProgressEvent.PRO GRESS,checkLoadProgress);
function checkLoadProgress(event:ProgressEvent):void {

[code]....

p.s. i also tried to seperate them on different scenes but this doesn't work either.

View 1 Replies

ActionScript 3.0 :: Preloader - Stage - #1009 Error: Cannot Access

May 5, 2010

I've been trying to load external swf ("index.swf") with the following code in AS3:

[Code]...

Of course I receive the #1009 error : Cannot access a property or method of a null object reference. I guess it is some "stage issue" but I'm not familiar enought with AS3 to avoid the problem by my own.

View 5 Replies

ActionScript 3.0 :: Error 1009 For Preloader And Fullscreen Method?

Jul 26, 2009

I use flash cs4. I tried to use a fullscreen method, which is I learned at internet, and make a preloader.

View 2 Replies

ActionScript 3.0 :: Preloader Pops TypeError: Error #1009?

May 2, 2011

I've made preloaders in the past, but now I'm getting this error, and I don't know what is exactly the problem. TypeError: Error #1009: Cannot access a property or method of a null object reference at com.mugui::Footer().If I erase all references of the footer from my Main Class the flash works normal. So the problem comes from my footer, but why?.My main class:

Code:
public class MuguiMain extends MovieClip
{
private var contentHolder:Sprite = new Sprite;[code]..........

View 3 Replies

Actionscript 3.0 :: Preloader Pops TypeError: Error #1009:

May 2, 2011

I've made preloaders in the past, but now I'm getting this error, and I don't know what is exactly the problem. TypeError: Error #1009: Cannot access a property or method of a null object reference at com.mugui::Footer()

If I erase all references of the footer from my Main Class the flash works normal. So the problem comes from my footer, but why?.

My main class:

Code: Select allpublic class MuguiMain extends MovieClip
{
private var contentHolder:Sprite = new Sprite;
private var mainContent:MainContent = new MainContent();

[Code].....

View 3 Replies

Actionscript 3.0 :: Preloader Error #1009 - Losing Content Functionality

Mar 19, 2010

First off, I want to say that this is my first time posting on this site. I have frequented gotoAndLearn for a couple years and it has always proven to be incredibly useful for me as a novice coder. On to my problem: I have the basic skeleton for a portfolio site built using AS3. It runs like a dream when I test it on my computer, but when I posted it online it lags, creating a jittery effect that, we can all agree, is not desirable. To remedy this I have used Lee Brimelow's AS3 preloader tutorial to create a simple progress bar/preloader. The preloader works fine when simulated and the portfolio file loads, as well. I do, however get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at Portfolio_fla::MainTimeline/frame1()

View 4 Replies

Actionscript 3.0 :: Preloader (Error #1009: Cannot Access A Property Or Method Of A Null Object Reference)

Jan 21, 2010

I am having really annoying problems with Flash. I am using CS4 and the file uses AS 3.0. Anyway, on to the problem. Basically I am creating a flash-only website. Source code for main site:

[Code]....

After I have done this, the whole thing is not working anymore, and I get the following errors: TypeError: Error #1009: Cannot access a property or method of a null object reference. at website_fla::MainTimeline/frame2()[website_fla.MainTimeline::frame2:3] at flash.display::MovieClip/nextFrame()

View 8 Replies

ActionScript 3.0 :: Error #1009 - TypeError: Error #1009: Cannot Access A Property Or Method Of A Null Object Reference

Mar 26, 2009

TypeError: Error #1009: Cannot access a property or method of a null object reference. at MethodInfo-11() where is methodInfo-11?

[Code]....

View 4 Replies

ActionScript 3.0 :: Preloader Keeps Displaying An Error #1009: Cannot Access A Property Or Method Of A Null Object Reference?

Nov 23, 2010

My preloader keeps displaying an error when I try and load my SWF in it.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Main()

The swf works fine but the loader doesn't work with it. I worked out that it was because I used "stage" in the eventlisteners of the SWF file but if I remove these the game keys don't work, but the loader does.

View 3 Replies

Actionscript 3.0 :: Get Preloader Working - Error #1009: Cannot Access A Property Or Method Of A Null Object Reference

Jun 20, 2009

I have a preloader which has this code (simplified):

Code: Select allvar loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
loader.load(new URLRequest("x.swf"))
function loaded(e:Event):void
{}

And x.swf has this code (very simplified): Code: Select alltrace(stage.stageWidth); When I run preloader, I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at x_fla::MainTimeline/frame1()

View 2 Replies

Actionscript 3.0 :: Preloader - TypeError: Error #1009: Cannot Access A Property Or Method Of A Null Object Reference?

Jul 19, 2009

how to change different section with as3 and custom document class, everything run fine , but when i try to use the preloader tutorial that load the swf file , i run to some error it said " TypeError: Error #1009: Cannot access a property or method of a null object reference.

at Main/init()
at Main()"

Main is the name of my custom document class, and here is my document class code

Code: Select allpackage
{
import flash.display.MovieClip;[code]....

View 3 Replies

Actionscript 3.0 :: External Preloader - Error #1009: Cannot Access A Property Or Method Of A Null Object Reference

Apr 23, 2010

I just found the external preloader tutorial and it's Perfect, exactly what I needed! I just have one issue which I can't figure out.. It all works fine with other swf files such as the content.swf example it comes with, however when I try link it to a site I'm making (a fluid as3 layout) it states: "TypeError: Error #1009: Cannot access a property or method of a null object reference. at Website()" Here is the syntax - it's just the same as on the tut but trying to load 'website.swf'..

[Code]...

View 4 Replies

Error #1009 Error #1009: Cannot Access A Property Or Method Of A Null Object Reference

Aug 9, 2010

Error #1009: Cannot access a property or method of a null object reference.

This is the error I cannot seem to understand. On the stage I have a movie clip, mcTree. It's keyframe is in frame 3143. There is no tween or anything. In frame 3144, I have the following actionscript:

mcTree.gotoAndStop(2);

I publish the movie and I get to frame 3144 then BAM TypeError: Error #1009: Cannot access a property or method of a null object reference.

at 2file_fla::MainTimeline/frame3144()

As you can tell, I'm more than 3000 frames into my animation here and have made it this far using this method, and it has worked.

View 4 Replies

ActionScript 3.0 :: Preloader.swf Is Loading A Home.swf Error #1009: Cannot Access A Property Or Method Of A Null Object Reference

Jul 26, 2011

I am quite confident i am having no issue with my preloader codes and have managed to identify why i keep getting the Error #1009: Cannot access a property or method of a null object reference. My preloader.swf is loading a home.swf. Within this home.swf i have some codes that makes reference to the stage. EG stage.stageWidth/2 Once i deleted away this line of code there is no error. Is there anyway that i can still reference my stage in home.swf without getting Error #1009?

View 2 Replies

ActionScript 3.0 :: Error #1009 (class And Package)

Jul 28, 2011

This is my code

ActionScript Code:
package test{
class Main{
public function Main(){
}
}
}

View 6 Replies

ActionScript 3.0 :: Loading A Swf Created Using Document Class Gives Error #1009

Aug 29, 2007

Well the shiny new app is now 830K and needs to be preloaded. Simple eh? I've got a preloader that works nicely but I've been trying all day to find a reasonable way to load a swf that was compiled as a document class. My solution was to make a bare bones swf that would preload my main app swf:

[Code]....

View 6 Replies

ActionScript 3.0 :: Error 1009, Instantiating A Class That Extends A Sprite?

Apr 25, 2009

've tried calling constructor class from my main.fla, and it just doesn't work. The error when I try to instantiate the constructor is that it needs an argument... and since the class extends a Sprite.

PHP Code:
public functionportGal():void {
this._images = new Array();

[code].....

View 3 Replies

ActionScript 3.0 :: TypeError: Error #1009 When Adding Custom Class To Stage

May 18, 2009

I have extended a RadioButton into a custom class in order to store some extra info. I want to dynamically add these RadioButtons to the stage to create a dynamic menu box. So I started simple in order to make sure I knew how to do this.Here's the error (I love Flash IDE error reporting):

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.controls::RadioButton/drawLayout()
at fl.controls::LabelButton/draw()

[code]....

View 3 Replies

ActionScript 3.0 :: Imported Tweenlite Class On Main Stage - Error 1009

May 31, 2010

I am getting a 1009 error using tweenlite. I have placed the COM folder of tweenlite in the same directory as the FLA. On the main stage I have imported the tweenlite class using:
Code:
import com.greensock.*;
import com.greensock.easing.*;

On the main stage I have a MC called mainholdermc. When I click a button called mentions but on the main stage it basically tells mainholdermc to play. This works well. I have another movieclip called vosdes. At the same time that mainholdermc plays I want to use tweenlite to make the aplha of vosdes lower. If I put this actionscript on the main page it works fine:
Code:
mentionsbut.addEventListener(MouseEvent.CLICK, mainholder);
function mainholder(event:MouseEvent):void {
mainholdermc.gotoAndPlay(2);
TweenLite.to(vosdes, 0.4, {alpha:0.1});
}

The problem is that I want to move the tweenlite command to within the the vosdes movieclip. So within the vosdes movieclip I have this written in the actionscript:
Code:
import com.greensock.*;
import com.greensock.easing.*
TweenLite.to(this.vosdes, 0.4, {alpha:0.1});

I found that by using
Code:
this.MC_NAME
it is the equivalent of the _root in AS2.

However this is not working. When I compile the FLA no errors occur until I click on the mentionsbut and I get the following error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.greensock::TweenLite/init()
at com.greensock::TweenLite/renderTime()
at com.greensock.core::SimpleTimeline/renderTime()
at com.greensock::TweenLite$/updateAll()
[Code] .....

View 2 Replies

Actionscript 3 :: Replacing All Of The Class Files With The Tutorial Specimen Ones - TypeError: Error #1009

May 21, 2010

I have tried replacing all of the class files with the tutorial specimen ones but i still get the error.

[Code]...

Now, not really understanding the error properly I paste dumped the files online for you to look at.

[Code]...

As the error still occured when using the specimen class files I really have no idea where to begin.

View 2 Replies

ActionScript 3.0 :: Change Slide-show Into Working Document Class Without Error 1009?

Feb 11, 2010

I'm trying to make a slide-show that adjusts to the width or height of the stage, and eventually, of the web browser window. I was able to load and resize a picture by writing code on the timeline, but I got the Error #1009 (Cannot access a property or method of a null object reference) when I put this slide show into another movie clip loader (which chooses between different swf pages of the website, with the purpose of keeping the swf file sizes down). By the way, my "slide-show" loads the picture fine. When I use the movie clip loader to load this "slide-show" it works too. Only when I use the Flash Player to open it, it gives me the Error 1009. I looked around on actionscript.org, and everyone seems to be recommending the folowing code (or something like it):[code]

I also ran into some information about document classes and I figure maybe I should be using document classes to make this stuff more modular and reusable. So I put my slide-show code into an .as file, importing all the flash.xxx.* classes, and put it in a package and class and constructor function... in the same directory as my swf file, and set it as the document class to a blank fla file. Then I tested it and all I got was a blank swf. This is without the Event.ADDED_TO_STAGE code. I guess I don't know how to get the document class thingy working either. So my question is, can someone tell me how I can change my slide-show code into a working document class without the Error 1009?r?[code]

View 1 Replies

ActionScript 3.0 :: External Preloader Error #1009 "Cannot Access A Property Or Method Of A Null Object Reference"

Jun 10, 2009

I used an external preloader to call a swf is totally calling all the objects and functions through class, and there is nothing on the stage and timeframe. It shows TypeError: Error #1009: Cannot access a property or method of a null object reference. at main() Isit because i must put something on the stage or timeline for it to load??

[Code]...

View 11 Replies

ActionScript 3.0 :: Keep Getting Error 1009 Until SWF Movie Window Closed?

May 28, 2010

I have created a simple slideshow of thirteen frames. The slideshow script starts at Frame 2. This is because I have inserted a preloader in Frame 1. When I output my SWF and upload it to the web, it pulls down without incident. However, when I "Simulate Download" locally, Flash says this in the Output window:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at AS3GallerywPreloader_fla::MainTimeline/updatePreloader()
[AS3GallerywPreloader_fla.MainTimeline::frame1:9]
And it keeps writing this error message, ad infinitum, until I close the SWF movie window!

Here is the preloader script:
stop();
loaderInfo.addEventListener (ProgressEvent.PROGRESS, updatePreloader);
function updatePreloader (evtObj: ProgressEvent): void{
var percent:Number = Math.floor((evtObj.bytesLoaded*100) /evtObj.bytesTotal);
preloader_txt.text = percent+"%";
if (percent==100) {
nextFrame ();
}}

I should note that the slideshow portion functions as it should (the Back and Forward buttons advance frame by frame). In essence, the whole movie works. But I suspect I that error code is a bad thing to have. I ran the "Debug" feature (Debug-->Debug Movie), but got no apparent indication of a bad line of code.

View 6 Replies

Actionscript 3 :: Getting Error #1009: But Buttons Loaded On Movie Load?

Dec 28, 2011

In my 1st frame I have the following action script and it works fine.

cal.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "cal" )});
trucks.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "truck" )});
raven.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "raven" )});
frank.addEventListener(MouseEvent.CLICK, function(){gotoAndStop( "fr" )});

[Code].....

I've posted a lot of code below. It still loads / traces fine on frame 1. On other frames only the last two come up in a trace (though they should all be the same). Then when returning to frame 1 they are all null.

View 1 Replies

ActionScript 3.0 :: Copy The Movie Clip And Paste It Further Down The Time Line - Error 1009

Jul 1, 2009

I am having a problem with the error above as follows i have a video which is working fine on frame 12, but when I copy the movie clip and paste it further down the time line to work on a different page I get

[Code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved