Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Loader.close() not working

This is a discussion on Loader.close() not working within the Flash CS3 eng forums, part of the English Forums category; Hi, I have a major problem with loader.close(). Acording to Adobe, this Cancels a load() method operation that is ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-11-07, 15:54
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Loader.close() not working

Hi, I have a major problem with loader.close(). Acording to Adobe, this
Quote:
Cancels a load() method operation that is currently in progress for the Loader instance.
The problem is I can't get this to work.

When I click green button, load content.swf
Code:
private function onGreenClick(event:MouseEvent):void
		{
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComp);
			loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
			loader.load(new URLRequest("content.swf"));
		}
When I click another button, close the loading stream (stop the movie from loading)
Code:
private function loadImage():void
		{
			loader.unload();
			try
			{
				loader.close();
				killLoader();
				trace("stream closed");
			}
			catch(error:Error)
			{
				trace("can't stop stream");
			}
		}
		private function killLoader():void
		{
			trace("killoader");
			removeChild(loader);
			loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadComp);
			loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
		}
What am I doing wrong because this is not working ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 05-11-07, 16:04
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Loader.close() not working

Try to delete this line : loader.unload();
__________________

 


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

  #3 (permalink)  
Old 05-11-07, 16:10
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: Loader.close() not working

Nope, still not working.
I am checking this with a TextField that displays the percent loaded.

When I click stop button, It traces
Code:
killoader
can't stop stream
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 05-11-07, 16:18
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Loader.close() not working

This is interesting cos i never used it yet

What about:
Code:
			try
			{
				loader.close();
				loader.unload();
				killLoader();
				trace("stream closed");
			}
__________________

 


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

  #5 (permalink)  
Old 06-11-07, 07:58
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: Loader.close() not working

I got it.
It's yet another flaw in Simulate Download. The loader.close() works like a charm on the web. It even keeps the data in browsers cache so next time you load the stoped stream it will resume from there. Nice
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 3 Stop(); function not working?! mother Flash CS3 generale 1 20-10-08 13:04
Actionscript 3 Poll in CS3 not working! Pls help flasher10 Actionscript 3.0 newbies 0 01-10-08 10:57
IE not working right -captain-america HELP free utilities 0 01-05-08 17:51
Loader wias64 Actionscript 3.0 base 1 07-04-08 09:27
Method Call not fully working fried Actionscript 3.0 newbies 1 13-03-08 13:06


All times are GMT. The time now is 16:44.


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


FlepStudio
by Filippo Lughi
P.IVA 03605860406