Never mind...I figured it out. Thank you very much Flep!!! Your tutorials are great!
Vincent
Hello,
I want to load following swf: http://www.flepstudio.org/forum/down...do=file&id=103
into my main stage. The movie itself runs perfectly but as soon as I call it through the main stage it throws a
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at collection/init()
at collection()
I tried
public function collection() {
if (stage == null) {
addEventListener(Event.ADDED_TO_STAGE, loadXML);
} else {
Security.LOCAL_TRUSTED;
init();
loadXML();}
}
but this only leads to another error.
It would be great if somebody could help me to fix this issue.
Thanks
Vincent
Never mind...I figured it out. Thank you very much Flep!!! Your tutorials are great!
Vincent
Hi,
Would you share the solution you found Vinnie ?
I get the same error message while trying to load an external swf file...
Thanks
Hi Flep, thanks for your answer
I'm trying to load an external swf file (a photo gallery I found on ffiles.com) but I get an error message.
I came across your forum while Googling my error message.
If there's a quick way for you to help me I would be very grateful but I don't want to bother your with code that you didn't wrote or presented on your website.
The code I use to load the movie is :
the exact error message is :Code:var thisMovieClip:MovieClip; var thisLoader:Loader = new Loader(); thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading); thisLoader.load( new URLRequest("galerie.swf") ); function doneLoading(evt:Event):void { thisMovieClip = MovieClip(thisLoader.content); thisMovieClip.x = 510 thisMovieClip.y = 340 addChild(thisMovieClip); thisMovieClip.stop(); }
TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
at classes::Script$iinit()
TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
at classes::ImageViewer$iinit()
at classes::Script/::xmlLoaded()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
(sorry, french version...)
I have to admitt that I don't understand half of the code...and error message...
I'm amongst the huge quantity of non-programmer graphics designers who had a shock discovering that Flash CS3 doesn't allow some easy tricks anymore...
But again, I would perfectly understand if you can't support this one.
Hi,
I think you have some code into the external SWF that try to call some objects and it does not get it.
You can easy solve by using ADDED_TO_STAGE event.
Add into your external SWF that event:
Code:addEventListener(Event.ADDED_TO_STAGE,init); function init(evt:Event):void { // here write the code }
Hi Flep,
Thanks a lot for your help.
When I add the code with the ADDED_TO_STAGE event, I get an error message related to packages (unexpected package)
I think I have to start everything over instead of copying pieces of code that I don't fully understand...
The other sections of your website will certainly be of great interest to help me to learn AS 3 from the start![]()
I think the following tutorial can help you:
Event.ADDED_TO_STAGE
Bookmarks