Jump to content
Search Community

gigbig

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by gigbig

  1. Hi, I am using TweenLite with Away3D, and I am rescaling a Mesh with an Elastic tween: the code is as follows

     

    TweenLite.to(this, magnifyTime, {x: this.x + deltaX, z: this.z + deltaZ, y: this.y * zoomScale, scaleX: diceScale * zoomScale, scaleY: diceScale * zoomScale, scaleZ: diceScale * zoomScale, onUpdate: updateShadow(), ease: Elastic.easeOut, onComplete: trace, onCompleteParams: ["this.scaleX = " + this.scaleX]} );
    

    My problem is that the mesh (this) scales correctly, multiplying the initial scale 1 by 2.5, obtaining a 2.5 scale, but when the tween reaches the onComplete event it traces "1"!

     

    WHY?! Am I missing a stupid detail I can't see?

    I need to update the shadow in the onUpdate event, but if I can't get the correct mesh scale it remains unchanged! The onComplete event it just a test, I will delete it: I need the changing value of the scale, but the tween register the initial value, so... who can I constantly update the shadow with the correct scale?

  2. Hi,

    my question could sound noobish, but... I'am having a headache trying to do a very simple operation.

     

    I have loaded a SWF with SWFLoader, and now I want to instance a Bitmap with linkage "DotMatrixPattern" and use its Bitmap content to create a pattern with beginBitmapFill: the problem is... how do I extract the Bitmap from DotMatrixPattern?

     

    I am able to instance DotMatrixPattern, but then? DotMatrixPattern.rawContent? No! undefined!

     

    What am I doing wrong?

  3. Hi,

    I'd like to know how I could get an Array of all the class definitions from a SWF loaded with SWFLoader.

     

    Is it possible or I need to use some kind of workaround?

     

    And... how can I get the content to cast to ByteArray like I can do with an URLLoader?

     

    ByteArray(URLLoader(-url_loader-).data); 

     

    Thanks

  4. Hi,

    I need to animate an object, setting just a few parameters everytime I create a new tween, keeping the previous parameters if they are not overwritten, like in the standard AS3 tween class.

     

    As an example: I have a spinning ball, animated by

     

    TweenLite.to (ball, 10, {rotation: 2000});

     

    and after a few seconds from its creation I want the ball to start moving on x

     

    TweenLite.to (ball, 5, {x: 300});

     

    Normally the second tween kills the first one. How can I asynchronously "sum" the two tweens?

    Thanks

  5. Ok, ok, I have read the documentation, but I can't get my program to extract a class from a loaded SWF.

     

    The working version uses the Flash native loader

     

    ldrContext = new LoaderContext(false, ApplicationDomain.currentDomain);
    var request_graphic:URLRequest = new URLRequest(urlG);
    ldr_graphic.load(request_graphic, ldrContext);
    ...
    var MC : Object = ldr_graphic.contentLoaderInfo.applicationDomain.getDefinition(className);
    return new MC;  

    ---> returns the correct instance of the class

     

     

    while using SWFLoader

     

     

     

    gr =  new SWFLoader(urlG, { name:"graphic", context:ldrContext, estimatedBytes: 200, container:this, autoPlay:false } );
    gr.load();
    var c:Class = gr.getClass(className); 

    ---> c is null

     

     

    WHY?! I already have a "*" crossdomain

  6. Hi guys! My first topic here!

    I have an array of pages, and I want to go to the previous/next one using tweens, with different types of transitions, horizontal sliding (x coordinate), vertical sliding (y coordinate), fading (alpha parameter) or rotation (rotationY parameter).

     

    I want to convert classic tweens to tweenlite. The original code (for just one of the two pages moving) was

    
    new Tween(pages[whatever], transitionType, Regular.easeOut, BStart, BEnd, transitionSpeed, true);
    
    

     

    where transitionType can be "x", "y", "alpha" or "rotationY", corresponding to 4 MovieClip native properties.

     

    The stupid way would be the following code:

    
    switch (transitionType)
    {
    
    case "x" :
    pages[whatever].x = BStart;
    TweenLite.to(pages[whatever], transitionSpeed, {x : BEnd});
    break;
    
    case "y" :
    pages[whatever].y = BStart;
    TweenLite.to(pages[whatever], transitionSpeed, {y : BEnd});
    break;
    
    case "alpha" :
    pages[whatever].alpha = BStart;
    TweenLite.to(pages[whatever], transitionSpeed, {alpha : BEnd});
    break;
    
    case "rotationY" :
    pages[whatever].rotationY = BStart;
    TweenLite.to(pages[whatever], transitionSpeed, {rotationY : BEnd});
    break;
    
    }
    
    

     

    I need a smarter coding like

     

    
    pages[whatever].###transitionType### = BStart;
    TweenLite.to(pages[whatever], transitionSpeed, {###transitionType### : BEnd});
    
    

     

    in order to add n transitions corresponding to n MovieClip native properties without creating a giant switch, but just keeping 2 lines of code (classic tweens need just 1!).

     

    The problem is that I don't know how to use a string as a tween parameter name or a Movieclip property name.

    Can you help me, please?

×
×
  • Create New...