+ Reply to Thread
Results 1 to 4 of 4

problema posizionamento oggetto su stage

This is a discussion on problema posizionamento oggetto su stage within the Actionscript 3.0 base forums, part of the Flash Italiano category; Ciao a tutti, ho questa funziona che carica sia delle immagini (è solo un pezzo di tutto il codice) e ...

  1. #1
    Junior Member Settled In giannicasa is on a distinguished road
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    problema posizionamento oggetto su stage

    Ciao a tutti,
    ho questa funziona che carica sia delle immagini (è solo un pezzo di tutto il codice) e un file swf:

    Code:
    function loadImages():void
    {
    	for (var i:Number = 0; i < my_total; i++)
    	{
    		var my_url:String = my_images[i].@URL;
    		var my_loader:Loader = new Loader();
    		my_loader.load(new URLRequest(my_url)); 
    		my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    		my_loaders_array.push(my_loader); 
    	}
    	var my_logo:URLRequest = new URLRequest("logo.swf");
    	var loader_logo:Loader = new Loader()
    	loader_logo.load(my_logo);
    	addChild(loader_logo);
    }
    Come faccio a decidere il livello dei due caricamenti, o meglio, come faccio a dire che loader_logo deve stare sopra my_loader?
    Grazie anticipatamente a tutti!

    Giani
    Last edited by OrientExpress; 07-10-09 at 13:39. Reason: aggiunto i tags CODE

  2. #2
    Moderator Moving My Stuff To The FlepStudio OrientExpress is on a distinguished road OrientExpress's Avatar
    Join Date
    Aug 2009
    Posts
    1,277
    Rep Power
    5

    Re: problema posizionamento oggetto su stage

    Ciao giannicasa e benvenuto
    Prova così:
    Code:
    function loadImages():void
    {
    	for (var i:Number = 0; i < my_total; i++)
    	{
    		var my_url:String = my_images[i].@URL;
    		var my_loader:Loader = new Loader();
    		my_loader.load(new URLRequest(my_url)); 
    		my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    		my_loaders_array.push(my_loader); 
    	}
    	var my_logo:URLRequest = new URLRequest("logo.swf");
    	var loader_logo:Loader = new Loader()
    	loader_logo.load(my_logo);
    	addChild(loader_logo);
    	
    	swapChildren(loader_logo,my_loader);
    }

  3. #3
    Junior Member Settled In giannicasa is on a distinguished road
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    Re: problema posizionamento oggetto su stage

    grazie per la risposta, altra domanda..
    se volessi fare un random? o meglio, vorrei che le immagini non fossero sempre nello stesso ordine ma che avessero un avanzamento randomizzato
    come potrei fare?

    io ho queste funzioni oltre alla funzione loadimages() sopra citata

    Code:
    //funzione per far partire lo slide
    function startShow():void
    {
    	removeChild(my_preloader); 
    	my_preloader = null;
    	
    	addChild(my_slideshow);
    	my_slideshow.addChild(my_image_slides);
    	
    	nextImage();
    	
    	//new Tween(my_image_slides,"x",None.easeNone,0,200,20,true);
    	//new Tween(my_image_slides,"y",None.easeNone,0,200,20,true);
    	
    	my_timer = new Timer(my_speed*1000);
    	my_timer.addEventListener(TimerEvent.TIMER, timerListener); 
    	my_timer.start();
    }
    
    //funzione per l'avanzamento alle immagini successive
    function nextImage():void
    {
    	var my_image:Loader = Loader(my_loaders_array[my_playback_counter]);
    	my_image_slides.addChild(my_image);
    	my_image.x = (stage.stageWidth - my_image.width)/2;
    	my_image.y = (stage.stageHeight - my_image.height)/2; 
    	trace(my_image.x);
    	trace(my_image.y);
    	my_tweens_array[0] = new Tween(my_image,"alpha",Strong.easeOut,0,1,5,true);
    	my_tweens_array[0] = new Tween(my_image,"x",None.easeNone,15,-430),20,true);
    	my_tweens_array[0] = new Tween(my_image,"y",None.easeNone,15,-430),20,true);
    }
    Devo creare una funzione random e pensavo di applicarla alla funzione nextImage()
    o sbaglio?!
    Last edited by OrientExpress; 14-10-09 at 11:39. Reason: aggiunto i tags CODE

  4. #4
    Moderator Moving My Stuff To The FlepStudio OrientExpress is on a distinguished road OrientExpress's Avatar
    Join Date
    Aug 2009
    Posts
    1,277
    Rep Power
    5

    Re: problema posizionamento oggetto su stage

    Esatto.
    A prima vista credo che dovresti usare un numero random invece del my_playback_counter

+ Reply to Thread

Similar Threads

  1. [FL CS3 + AS3] Posizionamento nello stage al resize
    By steveaustin1974 in forum Actionscript 3.0 avanzato
    Replies: 15
    Last Post: 28-02-11, 15:06
  2. Oggetto rappresentante lo stage con evento on Load
    By lup0z in forum Actionscript 3.0 base
    Replies: 0
    Last Post: 09-03-10, 13:12
  3. Accedere ad un oggetto sullo stage
    By Andrea.B in forum Actionscript 3.0 base
    Replies: 2
    Last Post: 22-07-08, 19:56
  4. Caricamento filmati e posizionamento allo Stage...
    By SWFish in forum Actionscript 3.0 base
    Replies: 6
    Last Post: 04-11-07, 17:22
  5. Caricamento filmati e posizionamento allo Stage...
    By SWFish in forum Actionscript 3.0 avanzato
    Replies: 1
    Last Post: 04-11-07, 16:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts