Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Simple:Loading external SWF

This is a discussion on Simple:Loading external SWF within the Actionscript 3.0 newbies forums, part of the Flash CS3 eng category; First i am so sorry to ask such a retarded question, I really have been trying to figure this one ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > Actionscript 3.0 newbies

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 14-05-08, 02:18
Junior Member
 
Join Date: May 2008
Posts: 1
Rep Power: 0
mabron is on a distinguished road
Simple:Loading external SWF

First i am so sorry to ask such a retarded question, I really have been trying to
figure this one out on my own...I am a seasoned Video Editor trying to learn
Flash 9...I am using one of your SWFs and I get...I tried this both locally
and up on my server.



//METHOD ONE//
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

//METHOD TWO//
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Main/::init()
at Main$iinit()



//Method One//
var request:URLRequest = new URLRequest("my_path_local_machine/main.swf");
var loader:Loader = new Loader()
loader.load(request);
addChild(loader);

//Method Two; MAIN FLA IN SAME DIRECTORY//
var thisMovieClip:MovieClip;
var thisRequest:URLRequest = new URLRequest("main.swf");
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Even t.INIT, doneLoading);
thisLoader.load(thisRequest);

function doneLoading(evt:Event):void {
thisMovieClip = MovieClip(thisLoader.content);
stage.addChild(thisMovieClip);
thisMovieClip.stop();

Thanks...

Kindly,
Matt


</pre>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 14-05-08, 22:02
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Re: Simple:Loading external SWF

Hi ,

do not use local paths, it can't work with Flash.
If the SWF you want to load is in same folder of the loader SWF, use just main.swf ( not /localpath(main.swf )

About other method, do this:
Code:
var thisMovieClip:MovieClip;
var thisRequest:URLRequest = new URLRequest("main.swf");
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading);
thisLoader.load(thisRequest);

function doneLoading(evt:Event):void 
{
	var thisContent:MovieClip=MovieClip(thisLoader.content);
	thisMovieClip=new MovieClip();
	stage.addChild(thisMovieClip);
	thisMovieClip.stop();
}
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Simple GuestBook Flep FlepStudio utilities 45 30-09-08 20:42
How to create a site loading external SWF with Flash CS3 Flep Tutorials 31 01-09-08 14:01
Problem with loading external swf madmad Actionscript 3.0 newbies 2 28-05-08 20:36
Loading external XML files with Flash CS3 Flep Tutorials 14 19-11-07 14:23
website loading external swfs jimbo Actionscript 3.0 newbies 7 15-10-07 22:25


All times are GMT. The time now is 07:11.


Powered by vBulletin versione 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406