Jump to content
Search Community

gigbig

Members
  • Posts

    62
  • Joined

  • Last visited

Everything 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. Fixed! Idiot me: I have to remember that I instance a CLASS from the loader, and I have to instance it to obtain an object, it is not an object yet! Then I can simply throw it on a normal Bitmap.
  3. 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?
  4. Ok, for ByteArray I need DataLoader, I have found it by myself Now I need to extract the list of classes... If I know a className, can I instantiate it from a DataLoader? I hope I can use the DataLoader without downloading the same SWF twice to have a DataLoader and a SWFLoader...
  5. 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
  6. Great! Months ago I read a few lines about OverwriteManager, but I forgot about this feature! Thank you very much Carl!
  7. 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
  8. Fixed! It was a stupid bug: I was loading the SWF in LoaderMax (the code you saw was simplified) with other SWFs, but the loader of the interested SWF had a wrong name. Sorry for the useless discussion
  9. 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
  10. Great! And if I wanted to add an onComplete event? I will dig more inside Greensock...
  11. 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...