Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

swf esterni con enter_frame

This is a discussion on swf esterni con enter_frame within the Actionscript 3.0 avanzato forums, part of the Flash CS3 generale category; Ciao a tutti. Ho creato un caricatore di file swf e ho la necessità di "spegnere" l'evento ...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 e Actionscript 3.0 > Flash CS3 generale > Actionscript 3.0 avanzato

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 26-08-08, 15:51
Junior Member
 
Join Date: Aug 2008
Posts: 5
Rep Power: 0
blade666 is on a distinguished road
swf esterni con enter_frame

Ciao a tutti.
Ho creato un caricatore di file swf e ho la necessità di "spegnere" l'evento enter_frame di questi swf una volta eliminati tramite removeChild.
Ovviamente il problema è che quando rimuovo il child, gli eventi interni ad esso continuano a perdurare causando un rallentamento abnorme del filmato.

Ho chiesto su altri forum ma non ho ottenuto una risposta esauriente... come potrei fare?

Non posso mettere mano su quegli swf. Ma solo sul filmato base che li carica.

Grazie a tutti per eventuali risposte

Blade
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 26-08-08, 15:58
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,446
Rep Power: 6
Flep is on a distinguished road
Re: swf esterni con enter_frame

Ciao,
se non hai i FLA degli SWF che carichi non puoi cooscere i nomi delle MovieClip e quindi non puoi riferirti a loro
__________________

 


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 28-08-08, 17:08
Junior Member
 
Join Date: Aug 2008
Posts: 5
Rep Power: 0
blade666 is on a distinguished road
Re: swf esterni con enter_frame

e se conosco il nome di un metodo al loro interno che mi blocca l'enter_frame?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 29-08-08, 06:46
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,446
Rep Power: 6
Flep is on a distinguished road
Re: swf esterni con enter_frame

Allora basta che chiami quel metodo...
__________________

 


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 05-09-08, 17:47
Junior Member
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
cicobalico is on a distinguished road
Re: swf esterni con enter_frame

come puoi chiamare un metodo di un swf esterno? tramite la classe loader?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 07-09-08, 11:24
Silver55's Avatar
Junior Member
 
Join Date: Sep 2008
Posts: 9
Rep Power: 0
Silver55 is on a distinguished road
Re: swf esterni con enter_frame

Ciao,
...nel caso tu conosca il nome dell'ascoltatore associato all'evento ENTER_FRAME di un SWF caricato ( o qualsiasi altro metodo ) , per richiamarlo fai riferimento al contenuto del Loader ed al metodo interessato.

Code:
// ..........................................................
//  NAME : Test_01.fla  
//         Caricamento di un SWF e "remove" di un Listener 
//         associato
// ..........................................................
 
import flash.net.URLRequest;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.display.MovieClip;
// ..........................................................
 
// ..........................................................
var urlFile        :String;
var urlRichiesta   :URLRequest;
var caricatoreSWF  :Loader;
var caricatoreInfo :LoaderInfo; 
var swf            :MovieClip
// ..........................................................
 
// ..........................................................
urlFile        = "swf_01.swf";
urlRichiesta   = new URLRequest(urlFile);
caricatoreSWF  = new Loader();
caricatoreInfo = LoaderInfo(caricatoreSWF.contentLoaderInfo); 
caricatoreInfo.addEventListener(Event.COMPLETE, completatoCaricamentoSWF); 
// ..........................................................
 
// ...sullo stage e' presente un Button per fermare 
//    l'evento ENTER_FRAME dell'SWF caricato
b_stopListener.addEventListener(MouseEvent.CLICK, fermaAscoltatoreSWF);
 
// ...carica l'swf 
caricatoreSWF.load(urlRichiesta);
 
// ..........................................................
//  FUNCTION : completatoCaricamentoSWF()  
//             Il File SWF e' stato caricato  
// ..........................................................
function completatoCaricamentoSWF(evento:Event):void  
{ 
 // ...il File SWF e' stato caricato !
 
 // ...crea un loader temporaneo (non necessario)
 var caricatoreTemp:Loader = Loader(evento.target.loader);
 
 // ...estrai l'SWF (reference) 
 swf = MovieClip(caricatoreTemp.content);
 
 // ...potevo riferirmi direttamente 
 // var mc:MovieClip = MovieClip(evento.target.loader.content);
 
 // ...aggiungi allo Stage
 addChild(swf);
 
 // ...etc....
} 
// ..........................................................
 
// ..........................................................
//  FUNCTION : fermaAscoltatoreSWF()  
//             stop dell'ascoltatore ENTER_FRAME 
// ..........................................................
function fermaAscoltatoreSWF(evento:Event):void  
{
 // ...rimuovi l'ascoltatore ENTER_FRAME presente nell'SWF 
 swf.removeEventListener(Event.ENTER_FRAME, swf.entrataNelFrame);
 
 // ...valore presente nel text field dell'SWF 
 // trace(swf.ctr.text);
 
}
// ..........................................................

...e qui SWF che prevede l'ascoltatore relativo all'evento ENTER_FRAME, da fermare dopo il suo caricamento

Code:
// ..................................................
//  NAME : swf_01.fla 
// ..................................................
import flash.events.Event;
// .....
var i:uint;
addEventListener(Event.ENTER_FRAME, entrataNelFrame);
 
function entrataNelFrame(evento:Event):void
{
 // ...incrementa una var. 
 // ...giusto per il test, per vedere quando si fermera'
 i++;
 
 // ...visualizza il numero di volte ( in un textfield )
 ctr.text = String(i);
}
// ..................................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7 (permalink)  
Old 01-10-08, 14:23
Junior Member
 
Join Date: Sep 2008
Posts: 1
Rep Power: 0
mmaculatell is on a distinguished road
Re: swf esterni con enter_frame

scusate io ho un file swf che ho realizzato con actionscript e devo caricarlo in un altro file come posso fare?
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
AS3 caricamento di swf esterni digitalfx Actionscript 3.0 base 1 26-05-08 15:33
Rendere pulsanti non cliccabili durante un Event.ENTER_FRAME dos Actionscript 3.0 base 2 21-03-08 15:20
Preload esterni Vampyro Actionscript 3.0 base 12 10-03-08 23:49
Timer vs ENTER_FRAME Flep Tutorials 0 18-12-07 06:27
Meglio usare Timer o ENTER_FRAME per creare animazioni ? Flep Articoli e tutorials 2 13-11-07 11:48


All times are GMT. The time now is 13:52.


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