Jump to content
Search Community

American horizon

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by American horizon

  1. Hi, is it possible with LoaderMax to load animated gif and play it once they are loaded?

     

    If not, there are other solutions without do it manually with specific software that converts gif in SWF movies? It will be useful to found a PHP script that do it automatically

  2. i seem to have missed a few comments but from what I can tell the advice that axon and I have given will work fine for you.

    you don't need to use the eventListener (method 2) that i suggested. a simple onComplete with onCompleteParams will work fine.

     

    please consider the following:

     

    
    //point supimg to a movieclip instance
    var supimg:MovieClip = mc2;
    
    //storing start values
    //you can use arrays/ids
    
    mc2.initX = mc2.x;
    mc2.initY = mc2.y;
    
    TweenLite.to(supimg, 1, {x:300, onComplete:finish, onCompleteParams:[supimg]});
    
    //immediately after tween starts change the value of supimg
    
    supimg = this;
    
    
    function finish(someObject){
    
    //this function has no idea what supimg is
    //it knows to tween mc2
    
    TweenLite.to(someObject, 1, {x:someObject.initX, y:someObject.initY});
    
    }

     

    I attached a cs4 fla that you can test. the main point is that supimg can change after the tween starts but the onComplete function will know exactly what clip to tween back to its origin.

     

    cool works!

    than trasnfering the paramters using [supimg], doesn't matter the real/actual content of supimg, the function only consider the tweened MovieClip

  3. Umh i don't understand

    My situation is that i've an image grid, then every image have an x and y position that i've to keep trace

    Then in posarrayx i trace the x position of the images and in posarray i trace the y position (it's like a matrix, but i've used two array)

     

    This because i can zoom images clicking on it, and closing it, they have to return into initial position memorized into posarrayx and posarray

     

    Now i haven't no array named "posarraImages"

  4. I don't know how your target of your tween is going to change after the tween is created, but I think you will find method 2 will be suitable

     

    you can just smack this code into a file with objects mc_1 and mc_2

     

    import com.greensock.*;
    import com.greensock.events.TweenEvent;
    
    //method 1 use onComplete callback and onCompleteParams
    
    TweenLite.to(mc_1, 2, {x:400, onComplete:standardCallback, onCompleteParams:[mc_1]});
    
    
    function standardCallback(something) {
    trace("callBack");
    trace(something);
    trace(something.name);
    
    /* output:
    
    callBack
       [object MovieClip]
       mc_1
    
    */
    
    
    }
    
    
    //method 2 add EventListener
    
    var boxTween:TweenMax = TweenMax.to(mc_2,3,{x:400});
    boxTween.addEventListener(TweenEvent.COMPLETE, completeHandler);
    
    function completeHandler(event:TweenEvent):void {
    trace("\nEventListener");
    trace("event: " + event);
    trace("event.target: " + event.target);
    trace("event.target.target: " +event.target.target);
    trace("event.target.target.name: " +event.target.target.name);
    
    /* output:
    
    EventListener
    event: [Event type="complete" bubbles=false cancelable=false eventPhase=2]
    event.target: [object TweenMax]
    event.target.target: [object MovieClip]
    event.target.target.name: mc_2
    
    */
    
    
    }

     

    cool method

    anyway in my case supimg change for a simple reason.. this is the code

     

    function apriimg(evt:Event):void
    {
    if (evt.currentTarget!=supimg)
    {
       if (supimg!=null)
             {TweenMax.to(supimg, 1, {scaleY: 1, scaleX: 1, x: posarrax[supimg.id], y: posarray[supimg.id], onComplete:riattivazoom})} //<---------- supimg tween starts
    
       supimg=evt.currentTarget //<-------supimg contens change in meanwhile
       TweenMax.to(evt.currentTarget, 0.5, {scaleY: 7, scaleX: 7, x: -250, y:100})
      }
    }
    

     

    then while supimg are tweening (it require 1 secondto complete operation) supimg change it contents

  5. Hi

    I want to know if is possible to launch a function through onComplete parameter, trasferring at the function the Object associated with the tween

     

    For example:

    TweenMax.to(supimg, 1, {x: posarrax[supimg.id], y:posarray[supimg.id], scaleY: 1, scaleX: 1, onComplete:riattivazoom})

     

    launching the function "riattivazoom", i want to trasnfer to it "supimg", but without using the real name of the variable (supimg) because in the meantime it content could be changed!

    I wanna be sure that tweenmax transfer at the function che precisious object thath have generated the "onComplete" event.

     

    I hope you understood me, i'm italian

  6. i looked at your file.

     

    and since your frame "cazzo" is on the main timeline you would not use mc as your target as mc does not have a frame labeled "cazzo".

     

    mc is used in the documentation as a generic instance name. 99% of the TweenLite tweens you will do will control movie clip symbols so you need the instance name to define which object you are tweening.

     

    also, the frameLabel plugin is usually used to play through frames in a timeline that already has some timeline-based motion/classic tweens in them. you only have 2 keyframes with static content so there isn't going to be much to see visually as the tween is running.

     

    read/watch this tutorial to see a common implementation of the frameLabel plugin:

    http://www.snorkl.tv/2010/10/overview-o ... backwards/

    ah ok, then writing the istance of the mc i can manage frames INSIDE the mc

  7. Also, if you are trying to control the main timeline and NOT a Movie Clip symbol, you can use the this keyword

     

    TweenLite.to(this, 1, {frameLabel:"mylabel",ease:Elastic.easeIn})

     

    writing "this" i haven't any error.. But i've wrote "mc" fallowing the official guide, obviously i've created a movieclip on stage called "mc"

  8. It sounds like your "mc" object is null (it doesn't refer to anything). Do you have a MovieClip on the stage with an instance name of "mc"? I bet you don't. If you're still having trouble, feel free to post a very simple FLA that demonstrates the issue.

    Yes i've created it on stage

     

    source file: http://digilander.libero.it/American_horizon/prova.rar

     

     

    anyway i d0nt understand why i have to apply this function on an object. Isn't it a plugin for manage timeline position?

  9. Hi, i'm an italian boy, the sorry for any error in my post

     

    I'm still a noob but i'm studying flash and action script programming includes tweenlite/max classes. Now i'm stuck on the understanding of the plugin called "FrameLabel".

    This is it syntax:

     

    TweenLite.to(mc, 1, {frameLabel:"mylabel",ease:Elastic.easeIn})

     

    I don't understand why i need to apply it on an object (mc)... Isn't it a thing that manage our position on timeline? Why i need aplly it on an object?

    Anyway when i execute my flash file, software give me this error:

     

    Error: Cannot tween a null object.
    at com.greensock::TweenLite()
    at com.greensock::TweenLite$/to()
    at Senzanome_fla::MainTimeline/frame1()
    at flash.display::MovieClip/gotoAndStop()
    at com.greensock.plugins::FramePlugin/set changeFactor()
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1006: value non è una funzione.
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
    at com.greensock.plugins::FrameLabelPlugin/onInitTween()
    at com.greensock::TweenLite/init()
    at com.greensock::TweenLite/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()

     

    This is the entire syntax used by me:

    import com.greensock.plugins.*;
    import com.greensock.*; 
    import com.greensock.easing.*;
    
    
    TweenPlugin.activate([FrameLabelPlugin, FramePlugin]);
    
    
    TweenLite.to(mc, 1, {frameLabel:"cazzo",ease:Elastic.easeIn})

×
×
  • Create New...