Jump to content
Search Community

andytwoods

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by andytwoods

  1. Hi there, probably a silly Q, but are there any features of LoaderMax that would let me interface with amazon s3 securely? Thanks, Andy.
  2. Hi there, going on a run but for quick eg's: 50ish videos: http://www.opensourcesci.com/experiments/Captavatar/ 100ish pics : http://www.opensourcesci.com/experiments/CaptavatarFace/ Note that the LoaderMax indicator shown in the swfs at these urls is as below. Cheers, Andy.
  3. Hi there, any thoughts on why this is so? Tempted just to use the DataLoader and process the dataarray myself Cheers, Andy.
  4. Might save someone all of 3 seconds if they want a way to reverse the order of their multi filtered tween var reverse:Boolean = true; var filters:Array = [ {dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:90, distance:0, inner:true}}, {glowFilter:{alpha:0, blurX:0, blurY:0, strength:5}} ]; if(reverse)filters=filters.reverse(); for(var filter_i:int=0;filter_i<filters.length;filter_i++){ TweenMax.set(us, filters[filter_i]); } //then later... myTween=TweenMax.to(us, 0.1, {dropShadowFilter:{color:0x000000, alpha:1, blurX:10, blurY:10, angle:90, distance:10, inner:true},glowFilter:{alpha:1, blurX:30, blurY:30,strength:5}});
  5. Thanks! That solves it Was initially hesitant as I thought this might muck up my saving of the tween (I reverse the tween later on) but, nope, works beautifully Cheers Mr GreenSock !
  6. Wowzers, using index does some strange stuff! Exploring the available parameters.
  7. Hi there, there is some variability when I apply the below tween to the orange circle. Sometimes it appears as the top circle appears, sometimes as the bottom circle. I guess the variability is due to the lack of order of stuff placed in Objects in AS3. Any way I can force one Filter to do it's stuff before another? Thanks myTween=TweenMax.to(us, 0.1, {dropShadowFilter:{color:0x000000, alpha:1, blurX:10, blurY:10, angle:90, distance:10, inner:true},glowFilter:{alpha:1, blurX:30, blurY:30,strength:5}});
  8. I just tried DataLoader and not VideoLoader (it actually is more befitting with my objectives as I don't need VideoLoader to play video). I didn't know you could play video from a bytearray: http://stackoverflow.com/questions/1553563/play-flv-from-bytearray-in-flash-player (there is a better example here: http://www.video-flash.de/index/netstream-bytearray-abspielen/). My video now works using the above. The loading process is twice as quick too (I guess loading is done in parallel with pure data?). I am sure that PepperFlash will get an upgrade shortly preventing this issue arising. Sorry though I 'jumped boat' exploring this issue (client deadline). Cheers, Andy.
  9. Ouch, irrespective of the files, after loading 22.5MB pepperflash crashes. I'll create a non loadermax version now but I suspect pepperflash is to blame.
  10. thanks, I'll report back after to let you know how things worked out. cheers, Andy.
  11. Hi there, PepperFlash is crashing when I loaded over 22 mb of FLVs with loaderMax. Proving quite hard to debug! Most likely it is something silly with my own code but just wondering if you can think of anything of the top of your head that could help. Curiously, Adobe Scout's reporting 120MB of memory used. The increase of memory used seems much larger than the individual FLV file size. I think flash has about 1GB of memory to play with in the browser but perhaps pepperFlash is odd? I don't use loaderMax to display video, just load them. I'm fairly certain it is not decoding the vids given line 1106 in VideoLoader and my own exploration of your code though. /** @private The video isn't decoded into memory fully until the NetStream is attached to the Video object. We only attach it when it is in the display list (thus can be seen) in order to conserve memory. **/ cheers, Andy. PS I should add that 22MB is just about all of the video that needs loading so it could be something firing 'on completion' that i need to explore.
  12. and this is how I should have done it: for (p in vars) { if (p in _reservedProps) { if (p === "onStartParams" || p === "onUpdateParams" || p === "onCompleteParams" || p === "onReverseCompleteParams" || p === "onRepeatParams"){ a = vars[p] if (a) { i = a.length; while (--i > -1) { if (a[i] === "{self}") { a = vars[p] = a.concat(); //copy the array in case the user referenced the same array in multiple tweens/timelines (each {self} should be unique) a[i] = this; } } } } My bad after all. Sorry bout that. cheers, Andy.
  13. yep (in tweenLite). Error at that long If statement protected function _initProps(target:Object, propLookup:Object, siblings:Array, overwrittenProps:Object):Boolean { var p:String, i:int, initPlugins:Boolean, plugin:Object, a:Array; if (target == null) { return false; } for (p in vars) { if (p in _reservedProps) { a = vars[p] if (p === "onStartParams" || p === "onUpdateParams" || p === "onCompleteParams" || p === "onReverseCompleteParams" || p === "onRepeatParams") if (a) { i = a.length;
  14. I BET this relates to these hacks I had to introduce because of Air to IOS compilation 'pain in the assness': http://forums.greensock.com/topic/6664-multiple-errors-in-flash-builder-47/ I'll have a quick look to see if errors arise near my hacks and report back. cheers, Andy. PS Just downloaded Tween* the other day in reponse to IOS silliness.
  15. Hi, I've a simple Tween: TweenMax.to(this, 1, {alpha:.2, repeat:1}); I get this error: TypeError: Error #1034: Type Coercion failed: cannot convert 1 to Array. at com.greensock::TweenLite/_initProps()[C:\Users\Andy\Desktop\xperiment\classes\com\greensock\TweenLite.as:551] at com.greensock::TweenLite/_init()[C:\Users\Andy\Desktop\xperiment\classes\com\greensock\TweenLite.as:522] at com.greensock::TweenMax/render()[C:\Users\Andy\Desktop\xperiment\classes\com\greensock\TweenMax.as:959] at com.greensock.core::SimpleTimeline/render()[C:\Users\Andy\Desktop\xperiment\classes\com\greensock\core\SimpleTimeline.as:166] at com.greensock.core::Animation$/_updateRoot()[C:\Users\Andy\Desktop\xperiment\classes\com\greensock\core\Animation.as:546] TweenMax.to(this, 1, {alpha:.2, repeat:[1]}); works though. Perhaps I am being silly, but I think repeat:1 is the correct way to specify repeat. Cheers, Andy.
  16. Hi Shane, totally agree with Adobe being silly regarding this. The problem is, with Air 3.6, it is now impossible to compile IOS apps using Tween* as Adobe INSIST one cannot use your cleverness. I fixed this by manually going through your code and doing what you suggest above: myVariable = obj.whatever; if (myVariable) {... Any chance you could incorporate this 'unnecessarily long' way of doing things in future versions? cheers, Andy. }
  17. Oops, silly mistake on my behalf was to blame for the crossed out stuff below. As ever GreenSock rocks. Hi, I seem to have the same problem as described here: http://forums.greensock.com/topic/3005-xmlloader-imageloader-problem/ I'm using the v latest version of loadermax. I can load flv but cannot seem to load png or jpg. No events are firing. Strangely, if I specify the wrong location for the png or jpg, LoaderMax complains loudly. Says nothing when these locations are correct. .cotent and rawContent return null. BTW, I googled for this problem and came up with the above site. When I entered it, it said I was logged in as someone else (Abdulah?). I changed my password immediately and it said 'welcome Andy' (the right name). Thanks, Andy.
  18. Thanks guys Ripping out my own timing stuff as we speak. Greensock is awesome.
  19. Wow, seems my views on how flash adds things to the display and then shows them on screen were not quite right. I only use code and don't use the timeline. I always thought adding a child to the display displayed it immediately but I now believe it is only added on the next frame. My q now is: if I ask timeline lite to show a sprite after 10000 ms, how precisely will it do so? Would it more accurately be displayed after 5000ms? I wonder if there timing errors accumulate in flash and whether timeline lite compensates for them. Sorry if this is a silly q Thanks Andy ---Original message Hi there, just wondering about the timing accuracy of timelinelite. I bet you have thought of and implemented everything to make things as accurate as pos but just to reassure me before i replace my own timing classes with yours, do you refer to system time regularly to update any timing wanderings? I am betting your timelinelite is a bazillion times more efficient and more accurate than my own home hashed hacks! Thanks Andy.
  20. Cool. Thanks! That weird motion I described was due to the moving Object expanding the size of the parent object (in my case, card). You just need to define the parent's width and keep it constant before running this function: protected function moved(e:Event):void { var xPerStepSizes:Number = 5; //5% steps along x-axis var yPerStepSizes:Number = 15; //15% steps along y-axis var xSpacing:Number = xPerStepSizes * 0.01 * card.myWidth; var ySpacing:Number = yPerStepSizes * 0.01 * card.myHeight; movingObj = manager.selectedTargetObjects[0]; movingObj.x = (((movingObj.x + (xSpacing / 2)) / xSpacing) >> 0) * xSpacing; movingObj.y = (((movingObj.y + (ySpacing / 2)) / ySpacing) >> 0) * ySpacing; manager.uS(); } If you want your object to move beyond the parent object though you can use this function instead (afraid I do not know how efficient modulus [%] is but it works fine my end): protected function moved(e:Event):void { movingObj=manager.selectedTargetObjects[0]; var xPerStepSizes:Number = 5; //5% steps along x-axis var yPerStepSizes:Number = 15; //15% steps along y-axis var xSpacing:Number = xPerStepSizes * 0.01 * card.myWidth; var ySpacing:Number = yPerStepSizes * 0.01 * card.myWidth; movingObj.x=movingObj.x-movingObj.x%xSpacing; movingObj.y=movingObj.y-movingObj.y%ySpacing; manager.uS(); }
  21. Note that using modulus you could potentially strip away most of the code in the above solution. I couldn't get it to work (there was some unwanted movement in some locations on screen) but if anyone does please let me know (there's an annoying bug with flash and floating point errors which I think are to blame). This could works most of the time: protected function moved(e:Event):void //couldn't get to work!! { var xPerStepSizes:Number=5; //5% steps along x-axis var yPerStepSizes:Number=15; //15% steps along y-axis movingObj=manager.selectedTargetObjects[0]; newX=movingObj.x; newY=movingObj.y; if(newX!=oldX){ newX=newX-newX%(xPerStepSizes*.01*card.width)); oldX=newX; movingObj.x=newX; } if(newY!=oldY){ newY=newY-newY%(yPerStepSizes*.01*card.height)); //-correctionX); oldY=newY; movingObj.y=newY; } manager.uS(); }
  22. Hi there, cool, all working . Jack, afraid I don't know what the updateSelection() function is, so my solution below is messy in that I had to insert a public function into your TransformManager to access it. Don't suppose there is a better way? Thanks! For the googler wondering what on earth I did, I firstly created Arrays containing the fixed positions I would like the given Sprite to 'snapto' (where 'card' is the parent Sprite in which my other Sprites are held; I liked the idea of allowing the user to go outside the parent sprite, hence 'additionalStepJumpZones'): private var stepJumpArrX:Array; private var stepJumpArrY:Array; private var additionalStepZones:uint=10; private function computeSnapToGrid():void { var myStepJumps:Array=new Array; myStepJumps.x=5; //percentage stepsize myStepJumps.y=20; //percentage stepsize constrainedX=true; constrainedY=true; if(myStepJumps.x!=0){ this.stepJumpArrX=new Array; for(var percent:Number=-(additionalStepZones*myStepJumps.x);percent<100+(additionalStepZones*myStepJumps.x);percent+=myStepJumps.x){ stepJumpArrX.push(percent*card.width*.01);//-correctionX); // containerWidth=cardWidth/myScaleX } } else(stepJumpArrX=null); if(myStepJumps.y!=0){ this.stepJumpArrY=new Array; for(percent=-(additionalStepZones*myStepJumps.y);percent<100+(additionalStepZones*myStepJumps.y);percent+=myStepJumps.y){ stepJumpArrY.push(percent*card.height*.01);//-correctionY); // containerHeight=cardHeight/myScaleY } } else(stepJumpArrY=null); } I next listened for when objects in the TransformManager were moved: manager.addEventListener(TransformEvent.MOVE,moved,false,0,true); When the objects were moved, I checked which point they were closest to and 'snapped them' to this point (note I've removed correctionX and correctionY, you could use these to offset the snapping, say to the middle of the moving object: correctionX=movingObj.width/2) : private var oldX:Number,oldY:Number,newX:Number,newY:Number; protected function moved(e:Event):void { movingObj=manager.selectedTargetObjects[0]; newX=movingObj.x; newY=movingObj.y; if(newX!=oldX){ newX=binary_search(stepJumpArrX,newX);//-correctionX); oldX=newX; movingObj.x=newX; } if(newX!=oldX){ newY=binary_search(stepJumpArrY,newY);//-correctionY); oldY=newY; movingObj.y=newY; } manager.uS(); } I searched for the nearest points using the below binary search that the folks at www.actionscript.org helped me refine (wikipedia recommended this searched as v v efficient). Note the horrid 'manager.uS()' function I hacked into Jack's TransformManager (public function uS():void{updateSelection();} ... hoping there's a more elegant solution to this! private function binary_search(arr:Array, key:int):int { //as discussed here: http://www.actionscript.org/forums/showthread.php3?p=1129506#post1129506 //originally taken from en.wikipedia.org/wiki/Binary_search_algorithm var imin:int; var imax:int = arr.length - 1; var imid:int; var best:int; while (imax >= imin) { imid = imin + imax >> 1; best = arr[imid]; if (best < key) imin = imid + 1; else if (best > key ) imax = imid - 1; else return best; } if (key - arr[imin] > arr[imax] - key) return arr[imin]; return arr[imax]; } Please let me know if you spot ways to improve this code Cheers and happy coding, Andy.
  23. Cheers for your advice Totally agree about not having this snap to grid property for scaling and rotating. Would be quite bizarre! I'll have a go now (within the TransformManager class and failing that via that external way) and let people know how I did things in the end. Cheers, Andy.
  24. Hi Jack. Could you advise me how to implement a way so that dragged objects ‘snap’ to a regular grid of positions? I’m hoping this feature is already implemented but i’m sure I could hack this feature up (happy to share resulting code - I've this lovely binarySearch array function that could be useful). I’d link this ‘shap-to-grid’ property to your ‘rotate around point’ feature so that the snapping would occur at a set point on the object. Cheers, Andy PS Sorry, I posted this message also in your TransformManager comments page (free free to delete).
×
×
  • Create New...