Very Strange Issue with Error #1009


I'm trying to load an external .swf using UILoader. If the .swf doesn't have any code, it loads fine. But if I add any code, even only comments. It gives me this error.

Code: TypeError: Error #1009: Cannot access a property or method of a null object reference. at main_fla::MainTimeline/__setProp_BackgroundLoader_Scene1_BG_0() at main_fla::MainTimeline() TypeError: Error #1009: Cannot access a property or method of a null object reference. at main_fla::MainTimeline/LoadComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Here is my project.
http://kritphong.co.cc/downloads/project.zip
Posted On: Thursday 25th of October 2012 10:43:21 PM Total Views:  373
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




How to make a very simple self-made background with different colours...

I know that this might be a silly question but unfortunatly I can't figure out the answer for it! Well basically it's about getting a self-made background (or horizon) in an animation... THIS is a good example of the background I mean... Can someone please clarify to me how this is done I tried the brush and bucket with different transparencies and strokes but I can't get it right.. Thank you.
VIEWS ON THIS POST

117

Posted on:

Thursday 18th October 2012
View Replies!

A very simple design...help.

I hope this is the right place for this. my flash knowledge is very limited but have learnt a bit via the fla's on this site. I'm trying to design something really simple. Similar to a room planner. An empty room, and then pictures of about 6 or 7 items along the right. And to be able to drag those items into position in the room. Thats it really! Is there any movies on flashkit that might point me in the right direction
VIEWS ON THIS POST

148

Posted on:

Thursday 18th October 2012
View Replies!

CS3 Help with this very cool slide show

I have some experience with flash cs3. I'm trying to make a slide show something like this: http://www.bgsu.edu/flash/colleges.htm In the slide show you will see the orange lines going around the people, on the walk path under people's feet, and at the end covering the building. If somebody would give me an idea how to accomplish these effects it will be highly appreciated.
VIEWS ON THIS POST

112

Posted on:

Thursday 18th October 2012
View Replies!

Count frames? Perform action every 12 frames...

Ok..while I'm here...I'll ask for more help. I have a function that counts days and some other variables and displays the values via dynamic text. //---------------------------------- function incrementCount() { count++ if (count == 1) { d = 1; //days t = 1; // timesight tb c = 1; // competitor tb } else { if (count = 8) { d++ t = t + j c++ } day = "Day " + d timesightTB = int((t)*10)/10 + " TB"; competitorTB = c + " TB"; } My issue....I have to place the incrementCount(): function every 12 frames so that it increments the values. Seems like it would be easier to simply modify the script to count "every 12 frames" but I can't find anything that tells me how to "count frames" in flash. Seems to be this is probably basic but I've searched unsuccessfully....so how do you do this. How do I get my script to work so it's frame based so I don't have to put incrementCount() every 12 frames
VIEWS ON THIS POST

146

Posted on:

Thursday 18th October 2012
View Replies!

[CS3] Display final score error - very confused!

My game is as good as finished but i've found a bug. There is a score system and a timer - if your score is negative and timer is positive greater than the negative of the score there's no problem e.g. score = -10, time remaining = 50 then total = 40. However, if score = -50, time remaining = 10 the total displays 40 instead of -40 So, in short - the final score doesn't display the - symbol. The score carries over to the next level and displays negative as it should - so why not in the total! here is the code: PHP Code: Total=Number(score)+Number(timer); SOLUTION: DON'T EMBED THE TOTAL!!!
VIEWS ON THIS POST

128

Posted on:

Friday 19th October 2012
View Replies!

very simple string in variable problem

, I have a extremely simple problem here but my mind is not working at all today. I have the following code: ActionScript Code: var myMessage:String = "Copy the notes "; on the main scene, but i want to change the text in the string when it loads a different frame or scene. I generated a new scene and in the first actionscript layer i used: ActionScript Code: myMessage = "Scene 2 loaded" but it doesnt work.
VIEWS ON THIS POST

127

Posted on:

Friday 19th October 2012
View Replies!

Generate random string every time

I have a file uploader which I generate a random key with, and this key is used in the url to identify what file to download. But this key does not regenerate istelf between each upload unless I refresh the page. Could someone please take a look and help me determine what I need to do to achieve my goal. ActionScript Code: package { import flash.display.*; import flash.events.*; import flash.text.*; import flash.net.FileReference; import flash.net.FileReferenceList; import flash.net.FileFilter; import flash.net.URLRequest; import flash.utils.Timer; import flash.events.TimerEvent; public class Uploader2 extends MovieClip { function generateRandomString(strlen:Number):String{ var chars:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; var num_chars:Number = chars.length - 1; var randomChar:String = ""; for (var i:Number = 0; i < strlen; i++){ randomChar += chars.charAt(Math.floor(Math.random() * num_chars)); } return randomChar; } var file:FileReference; var filefilters:Array; var req:URLRequest; var tm:Timer; var speed:Number = 0; var currbytes:Number = 0; var lastbytes:Number = 0; var keyy = generateRandomString(6); public function Uploader2(){ req = new URLRequest(); req.url = ( stage.loaderInfo.parameters.f ) stage.loaderInfo.parameters.f : 'upload2.phpkey=' + keyy; file = new FileReference(); setup( file ); select_btn.addEventListener( MouseEvent.CLICK, browse ); progress_mc.bar.scaleX = 0; tm = new Timer( 1000 ); tm.addEventListener( TimerEvent.TIMER, updateSpeed ); cancel_btn.addEventListener( MouseEvent.CLICK, cancelUpload ); cancel_btn.visible = false; } public function browse( e:MouseEvent ){ filefilters = [ new FileFilter(' files', '*.*') ]; // add other file filters file.browse( filefilters ); } private function setup( file:FileReference ){ file.addEventListener( Event.CANCEL, cancel_func ); file.addEventListener( Event.COMPLETE, complete_func ); file.addEventListener( IOErrorEvent.IO_ERROR, io_error ); file.addEventListener( Event.OPEN, open_func ); file.addEventListener( ProgressEvent.PROGRESS, progress_func ); file.addEventListener( Event.SELECT, selectHandler ); file.addEventListener( DataEvent.UPLOAD_COMPLETE_DATA, show_message ); } private function cancel_func( e:Event ){ trace( 'canceled !' ); } private function complete_func( e:Event ){ trace( 'complete !' ); } private function io_error( e:IOErrorEvent ){ var tf = new TextFormat(); tf.color = 0xff0000; label_txt.defaultTextFormat = tf; label_txt.text = 'The file could not be uploaded.'; tm.stop(); cancel_btn.visible = false; select_btn.visible = true; } private function open_func( e:Event ){ //trace( 'opened !' ); tm.start(); cancel_btn.visible = true; select_btn.visible = false; } private function progress_func( e:ProgressEvent ){ progress_mc.bar.scaleX = e.bytesLoaded / e.bytesTotal; var tf = new TextFormat(); tf.color = 0x000000; label_txt.defaultTextFormat = tf; label_txt.text = Math.round( (e.bytesLoaded/e.bytesTotal)*100)+'% uploaded '+speed+' kb/s'; currbytes = e.bytesLoaded; } private function selectHandler( e:Event ){ file.upload( req ); } private function show_message( e:DataEvent ){ tm.stop(); var tf = new TextFormat(); if( e.data == 'ok' ){ tf.color = 0x009900; label_txt.defaultTextFormat = tf; label_txt.text = keyy; cancel_btn.visible = false; select_btn.visible = true; } else if( e.data == 'error'){ tf.color = 0xff0000; label_txt.defaultTextFormat = tf; label_txt.text = 'The file could not be uploaded.'; cancel_btn.visible = false; select_btn.visible = true; } } private function updateSpeed( e:TimerEvent ){ speed = Math.round( (currbytes - lastbytes)/1024 ); lastbytes = currbytes; } private function cancelUpload( e:MouseEvent ){ file.cancel(); reset(); } private function reset(){ cancel_btn.visible = false; select_btn.visible = true; label_txt.text = ''; progress_mc.bar.scaleX = 0; } } }
VIEWS ON THIS POST

144

Posted on:

Friday 19th October 2012
View Replies!

swfLoader.unloadAndStop() not removing everything

I'm using flash builder with the adobe AIR player, when I load an swf that loads another swf within itself then later run swfLoader.unloadAndStop() it removes everything but the swf that was loaded within the other swf. Why is this
VIEWS ON THIS POST

107

Posted on:

Friday 19th October 2012
View Replies!

I want everything back to the beginning

I designed a game ... I want at the end of the game as "game over" and the pressure on ... play again .... to delete everything like "all the moviecilps and object Which was add in the previous round of the game " as nothing was happening and game returned from the beginning again i use gotoandstop but it does not delete the objects and the moviecilps which was add in the previous round of the game .... and the game is going faster i don't know why is there any function can do this \t
VIEWS ON THIS POST

110

Posted on:

Friday 19th October 2012
View Replies!

every first letter to uppercase

toUpperCase() Method converts whole string touppercase. i want only first letter to uppercase. is it possible
VIEWS ON THIS POST

110

Posted on:

Saturday 20th October 2012
View Replies!

movie clip only plays every other time

i have a button with some code on it to play a movie clip when pressed. the movie clip should run until the last frame and then stop at the end where i have a stop action. what actually happens is the movie clip plays the first time the button is pressed but not the second time. the third time it plays again but not the fourth, the 5th time it plays etc. etc. i have noticed that if i change the stop action to a gotoAndStop(1) action the film plays everytime without problems. but what i need is it to play everytime and then stop at the end without going back to frame one until the button is clicked once more. any help greatly appreciated.
VIEWS ON THIS POST

94

Posted on:

Saturday 20th October 2012
View Replies!

Hi Everyone

I just finished my flash template (a.s.2.0). Everything looks ok in template. When I tried to publish it, browser shows just a certain part of my template and movie clip buttons are not functioning properly after the publishing.How should I adjust stage or bitmap (i use a bitmap picture for my bg) to be able to see whole site fit in browser. Should I add script for that or it's just about resizing Briefly, what should I do to configure my template so I can see it in browser when I publish it, just like I can see it when I test the movie. here is how it looks www.gulaydin.com
VIEWS ON THIS POST

111

Posted on:

Wednesday 24th October 2012
View Replies!

Check pattern on every word of a string?

Hi everybody, I've read some documentation about regular expressions in AS3. I was wondering if it is possible to check every word of a string for a pattern. If all the words satisfy the pattern, the test is passed, otherwise is failed. Here is an example of what I mean: Code: var reg:RegExp = /[a-z]/i; var str1:String = "a b"; var str2:String = "a 1"; trace(reg.test(str1)); // I would like to have this true trace(reg.test(str2)); // I would like to have this false Now both are true. What am I missing
VIEWS ON THIS POST

99

Posted on:

Thursday 25th October 2012
View Replies!

My loop targets "every other instance" by mistake

I have this loop that I run from the main class: ActionScript Code: for (var j:int = 0; j < allDownArrows.length; j++) { allDownArrows[j].removeSelf(); } the allDownArrows array is full of instances of the DownArrow class. And this is the function it should call inside the DownArrow class: ActionScript Code: public function removeSelf():void { removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)) stageRef.removeChild(this); } What happens is the removeSelf function only removes every other instance of the objects that are added to the stage. This is a guitar hero type of game I am making for a client and everything else is working really well except for this - I intended to use the loop function to remove every "note" object to serve as a 'quit' or 'back' button. Can anyone think of anything that could be causing every other "note" to be removed from an array
VIEWS ON THIS POST

117

Posted on:

Thursday 25th October 2012
View Replies!

Blur everything in background with a MC

I want to do similar to what can be seen here: http://activeden.net/item/masked-ima...ml-menu/109583 So I want to have a movieclip which blurs everything underneath (images, textfields, etc.) How can this be achieved
VIEWS ON THIS POST

108

Posted on:

Thursday 25th October 2012
View Replies!

This kirupa.com tutorial is either very bad or I'm missing something.

So I'm new to classes and followed this tutorial here: http://www.kirupa.com/developer/as3/classes_as3_pg2.htm Am I not seeing something or doesn't the tutorial explain how to actually import the class to .fla(not that I didn't figure it out), but for someone who wouldn't know about that, the tutorial would be waste of precious time.
VIEWS ON THIS POST

106

Posted on:

Thursday 25th October 2012
View Replies!

FlashBuilder 4 - Prevent FLA from publishing every time I save

, I have a Flash Professional CS5 project in Flash Builder 4, i'm trying to find a way to prevent it from publishing the FLA everytime I save, I only want it to publish when I actually debug or run it. Is this possible, it's driving me nuts, I can't do inline checking without saving, but saving means I have to wait for the FLA to publish. Help, anyone
VIEWS ON THIS POST

106

Posted on:

Thursday 25th October 2012
View Replies!

some very strange character conflict!!

Hi all This is not a problem.. I just want to share this in case someone can provide an explaination as I am baffled. See attached file Basically, simple AS3 button script.. 2 buttons and the script all works fine. However if you change the mc instance name to 'artists_mc' and also in the script then the artists_mc does not work!! I cannot understand this!! any offers of explaination cheers
VIEWS ON THIS POST

132

Posted on:

Thursday 25th October 2012
View Replies!

RegExpressions - Removing everything in between?

Say I have the following string: "Cotton 231 is & great43 for fun: Cotton"; I want to find and delete everything between the words Cotton via RegExp (because I don't know what will be inbetween Cotton, I just know Cotton is the magic word every time). I can .replace, which I intend to do, but I can't figure out what the RegExp would be Anyone know how this can be done
VIEWS ON THIS POST

109

Posted on:

Thursday 25th October 2012
View Replies!

Everything disappears when I'm in Fullscreen mode. What do I do?

I'm running a standalone EXE file via the Projector (or whatever it's called when you run a standalone EXE file made with Flash). It's NOT a web-based application. Every time I go to fullscreen mode, I just get a blank screen. of the images are gone. However, if I press Esc to exit the full screen mode, then the pictures appear again. Is this a bug with Flash CS3 This is what I put in the first frame of my movie in the 'actions' section: Code: import flash.system.fscommand; import flash.display.Stage; import flash.display.StageDisplayState; stage.scaleMode = StageScaleMode.SHOW_ALL; stage.displayState = StageDisplayState.FULL_SCREEN; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.displayState = "fullScreen"; stage['displayState'] = "fullScreen"; When I run the Flash program (as an exe file), the program goes fullscreen, but all of the elements on the stage disappear, leaving the screen blank. However, when I exit out of fullscreen mode (by pressing ESC) then everything looks like it's supposed to, with the images showing up and everything. Is there any way to fix this
VIEWS ON THIS POST

113

Posted on:

Thursday 25th October 2012
View Replies!