Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

aggiungere immagini su stage

This is a discussion on aggiungere immagini su stage within the Flash CS3 generale forums, part of the Flash CS3 e Actionscript 3.0 category; Buongiorno a tutti, sono nuovo di questo forum e da un mesetto mi diletto e uso Flash CS3, ho un ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 26-05-08, 15:16
Junior Member
 
Join Date: May 2008
Posts: 10
Rep Power: 0
mikvetere is on a distinguished road
aggiungere immagini su stage

Buongiorno a tutti, sono nuovo di questo forum e da un mesetto mi diletto e uso Flash CS3, ho un problema che non risco a risolvere e chiedo un aiutino alla comunity per un consiglio/soluzione, vi spiego:

ho la necessità di creare una gallery utilizzando un file xml esterno, riesco a leggere il file xml che contiene la url a 4 file jpg ma non ho capito bene, qual'è la procedura corretta per aggiungere le immagini sullo stage , nella posizioni desiderata e a intervallo di tempo regolare.....

confido su tutti voi.....

ringrazio flep per la marea di informazioni che ho trovato su questo sito.

Ciao
Di seguito il pezzo che ho fatto:

var my_xml:XMLDocument=new XMLDocument();
var loader:URLLoader=new URLLoader();
var request:URLRequest=new URLRequest('eventi1.xml');

loader.addEventListener(Event.COMPLETE,onComplete) ;
loader.load(request);

function onComplete(evt:Event):void
{
var result:XML=new XML(evt.target.data);
my_xml.ignoreWhite=true;
my_xml.parseXML(result.toXMLString());

var node:XMLNode=my_xml;
var totalNodes:int=node.firstChild.childNodes.length;

for(var i:int=0;i < totalNodes;i++)
{
var imageURL:String=node.firstChild.childNodes[i].attributes['url'];

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

  #2 (permalink)  
Old 26-05-08, 15:23
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: aggiungere immagini su stage

Ciao e benvenuto

Adesso dovresti inserire ogni url dentro ad un array.
Poi usando un timer e un contatore ( che va da zero alla lunghezza dell' array -1 ) carichi le immagini.
Puoi scaricare dalla sezione downloads qualche slide show a tempo che ho pubblicato che può aiutarti parecchio.
__________________

 


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 26-05-08, 17:56
Junior Member
 
Join Date: May 2008
Posts: 10
Rep Power: 0
mikvetere is on a distinguished road
Riferimento: aggiungere immagini su stage

Sto guardando tra i download, ma sono molto difficili, me ne puoi indicare uno semplice, o un tutorial che hai fatto sul come aggiungere img sullo stage caricate da un xml??

Grazie ancora e scusa il disturbo.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 27-05-08, 11:29
Junior Member
 
Join Date: May 2008
Posts: 10
Rep Power: 0
mikvetere is on a distinguished road
Thumbs up Riferimento: aggiungere immagini su stage

ho creato un array, e ho inserito tutte le url, ma come faccio a estrapolare le immagini dall'array per posizionarlo sullo stage??
Di seguito il codice??? Dove sbaglio???

var my_xml:XMLDocument=new XMLDocument();
var loader:URLLoader=new URLLoader();
var request:URLRequest=new URLRequest('eventi1.xml');

loader.addEventListener(Event.COMPLETE,onComplete) ;
loader.load(request);

function onComplete(evt:Event):void
{
var result:XML=new XML(evt.target.data);
my_xml.ignoreWhite=true;
my_xml.parseXML(result.toXMLString());

var node:XMLNode=my_xml;
var totalNodes:int=node.firstChild.childNodes.length;
//trace('numero totale di nodi: '+totalNodes);
var immagini:Array = new Array();
//inserisco le url dentro l'array
for(var i:int=0;i < totalNodes;i++)
{
//descrizione:String=String(node.firstChild.childNod es[i].attributes['descrizione']);
var imageURL:String=node.firstChild.childNodes[i].attributes['url'];
immagini.push(imageURL);

}
trace (immagini.length);
//aggiungo un evento TIME per gestire la sequenza temporale
var tempo:Timer=new Timer(1000, immagini.length);
tempo.addEventListener(TimerEvent.TIMER, posiziona);
tempo.start();

function posiziona(evt1:TimerEvent):void
{
\\Creo la funzione per posizionare le immagini all'interno dello stage
for (var a:int=0;a < immagini.length;a++)
{
???? come tiro fuori l'immagine dall'array????
var immagini[a]:MovieClip = new MovieClip();
immagini.x=300;
immagini.y=300;
addChild(immagini);
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 28-05-08, 22:38
sudo's Avatar
Junior Member
 
Join Date: May 2008
Posts: 16
Rep Power: 0
sudo is on a distinguished road
Re: aggiungere immagini su stage

var immagini
deve stare fuori dalla funzione onComplete altrimenti non è raggiungibile.
Quindi, fuori la dichiari:
var immagini:Array=new Array();
e dentro onComplete gli fai il push.
In questo modo puoi accedere a immagini anche dalla funzione posiziona.
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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 3 Aggiungere keyframe a MC creato dinamicamente hatejam Actionscript 3.0 base 3 30-07-08 17:18
Actionscript 3 come dimensionare immagini sullo stage minimauro Actionscript 3.0 base 3 16-07-08 17:52
Actionscript 3 Aggiungere listener ad una classe enricoB Actionscript 3.0 base 0 16-06-08 02:03
Actionscript 3 vissualizzare sullo stage immagini da XML Fedepag Actionscript 3.0 base 0 09-06-08 11:24
lo stage, incomprensioni nella manipolazione con la classe stage nextframe Actionscript 3.0 base 6 30-12-07 07:54


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


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