Jump to content
Search Community

BladePoint

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by BladePoint

  1. Thanks, that's an interesting read! But I'm hoping that my SWF will get spread around the internet like wildfire instead of people only accessing it through my website. In that case, it seems I have to host the data on my own server so I can set permission for the data to be accessed from anywhere, correct?
  2. When I test my Flash in Flash Professional (by pressing ctrl + enter) everything works fine, but when I try to play the SWF embedded in a local .html file or in a standalone player, I get the DataLoader Error #2048. It seems that has something to do with security permissions. I'm using a DataLoader to download a binary that I uploaded to my sites.google.com account. I was hoping to use that as a host for some data that my Flash will download when necessary. Is that not possible to do unless I'm the owner of the webhost so I can set my own permissions?
  3. My Flash runs at 60 fps and I have a MovieClip that is 10 frames long. I'm using TweenMax to play it over 10 seconds. TweenMax.to(mc1,10,{frame:10}); I would like to call a function every time TweenMax advances to the next frame of the MovieClip. If I use onUpdate, the function gets called 60 times a second instead of being called 1 time per frame. Adding an Event.ENTER_FRAME listener to mc1 calls the callback 60 times a second as well instead of each time the MovieClip advances to the next frame. Is there a way to do this with TweenMax? I'm trying to play two MovieClips synchronized. Using onUpdate with gotoAndStop works, but it gets called way more often than it needs to be.
  4. I had the same problem. I was using updateTo on values that were constantly changing and my onComplete didn't fire. I fixed it by giving my tween a variable name and then tweening it's time like this: TweenMax.to(myTween,duration,{time:duration,onComplete:myOnComplete}); I may still join Club GreenSock at some point though. Quick question, if I buy a single developer annual Business Green membership for $150 and decide to upgrade it to a permanent license within that same year, can I pay $600 instead of $750?
  5. Ah, thanks, I didn't know about the data thing. That should be very useful!
  6. I have identified the MP3loader I want to move by doing: var MP3loader:MP3Loader = LoaderMax.getLoader("myLoader"); I tried doing this to remove it from whichever loader it might be in and into the loader I want it to be in: MP3loader.parent.remove(MP3loader); targetLoaderMax.append(MP3loader); But apparently, "parent" is not a property of MP3Loader. How do I get the parent loaderMax of MP3loader, and is that even necessary? Does appending it to targetLoaderMax automatically remove it from the loaderMax it was previously in?
  7. I was just wondering if there was a TweenMax method that you could call during onUpdate that would tell it not to update for that tick. I didn't see anything in the docs, so I guess not. It's fine though, what I did seems to work well enough.
  8. Thanks, that idea worked. var tweenPoint:Point = new Point(1,0); // (scaleX,tick counter) TweenMax.to(tweenPoint,4,{x:1.015,onUpdate:updateFunction}); function updateFunction():void { tweenPoint.y += 1; if (tweenPoint.y % 2 == 0) myObject.scaleX = tweenPoint.x; } Out of curiosity, is there another way to make TweenMax directly skip an update during onUpdate?
  9. I am tweening a large, background object containing a high number of transparencies, and it seems to be causing a bit of a performance hit. I am just tweening its scaleX property from 1 to 1.015 and back on a yoyo loop over several seconds, so its a very subtle effect. My Flash is running at 60 fps, but this particular object probably doesn't need to be updated by TweenMax that often since the visual effect is so subtle. Is there a way to change the TweenMax's ticker speed just for this tween, so I can reduce the number of redraws and improve performance?
  10. Is it possible to change a loaderMax's onProgress, onComplete, and onError handlers after it has been created? I'm asking because my preloader uses a loaderMax to load some external content, and once it is done I would like to pass the loaderMax and it's loaded content into my main Flash. Alternatively, I could create a new loaderMax in my main Flash and pass the preloader's loaderMax content which is already loaded. Would a for loop of this work? mainLoader.append(preLoader.getChildAt(i));
  11. Nevermind, found this thread: http://greensock.com/forums/topic/7543-loading-bytes-with-swfloader/
  12. I am trying to switch over to LoaderMax because of all the added features, but I can't seem to convert my old Loader code to what LoaderMax needs. Here's my old code: import flash.display.Loader; [Embed(source="localBA.ba", mimeType="application/octet-stream")] var BAClass:Class; var BA:ByteArray = new BAClass as ByteArray; BA.inflate(); var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded); loader.loadBytes(BA); var mySprite:Sprite; function loaded(evt:Event):void { mySprite = loader.getChildAt(0) as Sprite; } And my new code: var dataLoader:DataLoader = new DataLoader("localBA.ba",name:"localBA",format:"binary",estimatedBytes:10000,onComplete:dataLoaded}); var mySprite:Sprite; function dataLoaded(evt:LoaderEvent):void { var BA:ByteArray = LoaderMax.getContent("D20BA"); BA.inflate(); mySprite = BA as Sprite; //mySprite apparently is null addChild(mySprite); } Any ideas about what I'm doing wrong? What is the DataLoader version of loadBytes?
  13. I'm working on a Flash that will stream large amounts of audio. I would like to be able to cache the audio on the user's computer so it doesn't have to get re-downloaded every time the user goes to my website and views my Flash. Does LoaderMax have any capabilities like that? If not, I was thinking of saving the audio with SharedObject or FileReference. If a cache of the audio file doesn't exist, or the CRC doesn't match, it gets downloaded from the server instead.
  14. I remember reading that you should call TweenLite instead of TweenMax if you're doing something that doesn't require TweenMax's added functionality, such as TweenLite.delayedCall, because it will be slightly faster. Is this still the case? I kind of remember reading somewhere that it doesn't matter now and you can just call TweenMax for everything.
  15. I've been using a dummy Tweenmax just so I can use its onUpdate. var dummyPoint:Point = new Point(0,0); //This only purpose of this point is to give TweenMax something with a property to tween. TweenMax.to(dummyPoint, 10, {x:1, repeat:-1, onUpdate:myFunction}); function myFunction():void { //This is the function that I would like to be called repeatedly. } The other ways that I've tried to continually repeat my function just end in an infinite loop error. With the dummy TweenMax, I don't get that and I can kill it whenever I want to. Is there a more elegant way to do this?
  16. I had to go to Publish Settings and set Export Classes to Frame 2. Then my selfLoader on frame 1 functioned properly.
  17. Hi, I'm in a similar situation in that my main timeline is blank and all my code is in the document class and other classes. The bulk of my Flash's file size comes from several audio and artwork assets in the library. I want to have a progress bar as my Flash loads, and I want everything in a single swf rather than using a second preloader swf. I put all my selfLoader code on frame 1, but when I test it the screen just stays blank until the entire swf is loaded, and then my progress indicator suddenly shows up at 100%. Any ideas on what I'm doing wrong? I'm using NetBalancer to limit my browser download bandwidth to like 10 KBps to test this.
  18. Is there a page somewhere on the site that lists what's new in each new version?
  19. Is there an easy way to make a delayedCall trigger now instead of at the end of the duration? Aside from doing killDelayedCallsTo and then calling it manually? The reason I ask is because I've got a delayedCall with some local variable parameters, and I want to be able to call it immediately instead on a key press. My keyboard handler function doesn't have access to those local variables. I suppose I could make them global instead.
  20. I've been able to reproduce this bug using some simple code. Any insight on what is causing it would be appreciated. What you should have is a container with a slightly 3D rotated green square on top of a larger red square. The red square fades in and out on a loop. The container is blurred. A more complex version of that is what I would like to happen in my actual project. But what really happens is that the moment the blurFilter is turned on, the green square disappears while the red square continues to fade in and out. When the blurFilter is removed, the green square comes back. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; var blurSprite:Sprite = new Sprite(); //This is the sprite to be blurred that will contain two child objects. //It will contain a red square with a smaller green square on top of it. var red_under:Sprite = new Sprite(); //This is the red square child which will be under the green square child. red_under.graphics.beginFill(0xff0000); red_under.graphics.drawRect(0,0,100,100); red_under.graphics.endFill(); red_under.x = 225; red_under.y = 150; red_under.alpha = 0; TweenMax.to(red_under,1,{alpha:1,repeat:-1,yoyo:true}); //The red square starts with alpha = 0 and tweens to alpha = 1 on a yoyo loop. blurSprite.addChild(red_under); var green_over:Sprite = new Sprite(); //This is the green square which will be on top of the red square. green_over.graphics.beginFill(0x00ff00); green_over.graphics.drawRect(0,0,80,80); green_over.graphics.endFill(); green_over.x = 235; green_over.y = 160; green_over.rotationX = -10; //The rotationX is key to reproducing this bug. Without it, the bug doesn't //occur. Unfortunately my real project needs it. blurSprite.addChild(green_over); addChild(blurSprite); TweenMax.to(blurSprite,0,{blurFilter:{blurX:4,blurY:4,quality:1},delay:1}); //You can see the green square disappear when the blurFilter kicks in after //a 1 second delay TweenLite.delayedCall(4,TweenMax.to,[blurSprite,0,{blurFilter:{blurX:4,blurY:4,quality:1,remove:true}}]); //To test that the blurFilter is really causing the green square //to disappear, I remove the blurFilter after a delay of 4 //seconds. When that happens the green square magically reappears.
  21. Oh thanks! I'll give the new plugin a shot. Actually I know what's causing the recompose error. You can't just make up random numbers for x, y, z, and w for a quaternion. They must follow this relationship: x = v1 * sin (theta / 2) y = v2 * sin (theta / 2) z = v3 * sin (theta / 2) w = cos(theta / 2) Where v1, v2, and v3 make up the axis of rotation and theta is the rotation angle. If they don't, you get the "ArgumentError: Error #2004: One of the parameters is invalid." message. UPDATE: The plugin works with proper x, y, z, and w values. For example {x:0, y:1, z:0, w:0} rotates it 180 degrees about the y axis. Oh and the invalid values that I was using earlier are from the QuaternionPlugin docs page at https://www.greensock.com/as/docs/tween/com/greensock/plugins/QuaternionsPlugin.html. You probably want to change those.
×
×
  • Create New...