Jump to content
Search Community

Sam

Business
  • Posts

    24
  • Joined

  • Last visited

About Sam

  • Birthday 12/02/1974

Contact Methods

Profile Information

  • Location
    Chicago Area

Sam's Achievements

2

Reputation

  1. Thank you Zack. That did help. I'm glad to hear that I didn't make a poor chose with what to call in GSAP. Any other tips would be appreciated. As for GSAP 3, what I have seen of it has me excited. I might do a performance profile of this same use case implemented in GSAP 3 to see if there's any boost.
  2. Hi Guys, I'm another AS3 GSAP guy whose been lurking around for ages. I've always appreciated the work that Jack and the others do so... Thanks. Without further ado, I recently took on a project wherein some brand images are bouncing around in the background of a page. I produced the code that is in the attached Codepen but I am seeing my CPU/GPU usage spike when leaving the page idle. I thought that I'd better check with the gurus before releasing something that's going to kill some nice ladies phone. 1000 foot view is that on init I build a container full of image elements with SVGs for their src and prime them with their first animation. The animations are to (somewhat) random x pos, y pos, scale, opacity, and rotation. I am using the callback at the end of the animations to trigger getting a new animation and each is 30 to 60 seconds long. So my code only gets touched once every 30-60 seconds per icon. The random calculations are all simple arithmetic with a minimum number of calls to Math.random(); Help Please! Am I doing something terribly wrong? Should I be throttling something somewhere? Thanks in Advance!
  3. For the scale, I have added to the updateScale method in the TransformManager: /** @private **/ private function updateScale($x:Boolean = true, $y:Boolean = true):void { var ti:Object = _trackingInfo; //to speed things up var mx:Number = _parent.mouseX - ti.mouseOffsetX, my:Number = _parent.mouseY - ti.mouseOffsetY; if (_bounds != null) { if (mx >= _bounds.right) { mx = _bounds.right - 0.02; } else if (mx <= _bounds.left) { mx = _bounds.left + 0.02; } if (my >= _bounds.bottom) { my = _bounds.bottom - 0.02; } else if (my <= _bounds.top) { my = _bounds.top + 0.02; } } if ( _snapScaleTo ) { mx = (((mx + (_snapScaleTo / 2)) / _snapScaleTo) >> 0) * _snapScaleTo; my = (((my + (_snapScaleTo / 2)) / _snapScaleTo) >> 0) * _snapScaleTo; } The _snapScaleTo variable is a public Number that I added as well. Whenever snap is turned on or the size of the grid is changed I update the transformManager.snapScaleTo to equal the grid value and set it to 0 if the grid or snap are turned off.
  4. First off, thanks for this. It was exactly the breadcrumbs that I needed to get a snap to grid function working. The transformManager appears to have a public updateSelection() method now so all that was required to get it function for position was to listen for the TransformEvent.MOVE, adjust the position and update the selection. Where I'm running into challenges is getting the snap to work on the TransformEvent.SCALE. Adjusting the display object, like in the move above, doesn't adjust the TransformManagers handles. So the display object snaps to the scale but the handle position remains unadjusted and is out of position with the display object. Any suggestions?
  5. Hello again! I am looking for more precise control over the positioning of an asset in the FlexContentDisplay when the scalemode is set to one of the proportional options. Currently there are options to set the position by alignment. Your VAlign and HAlign stuff. I'd like to be able to grab the image and drag it to a position withing the bounding box. I imagine it's someting like getting access to the wgap and vgap but I am not sure if there are pitfalls to this that I am not seeing. Can you help?
  6. Well I'll be. I'll need to find another way to trim the loaded audio then. Thanks Jack.
  7. For the record there is audio. It is loaded properly and a play call results in sound issuing forth from my speakers. I am even able to do an extract on that same content and manipulate the resulting byteArray. I am just not getting the SampleDataEvents.
  8. I am trying to access the SampleDataEvent for a sound that has been loaded by the MP3Loader. I had assumed that this would be as easy as adding an event listener to the content of the loader like so: ( ( _loader as MP3Loader ).content as Sound ).addEventListener( SampleDataEvent.SAMPLE_DATA, onSampleData ); ... but I am not seeing any events. Help Please
  9. RTFM. For the next slow poke... transformItem.scaleMode = TransformManager.SCALE_WIDTH_AND_HEIGHT now to get the ContentDisplay object to update as it is being scaled...
  10. I am trying to use the TransformManager in combonation with the LoaderMax ContentDisplay. In my application I expose the ContentDisplay scaleMode options to the user (ProportionalInside, ProportionalOutside, and Stretch). Attaching the TransformManager to the ContentDisplay works just fine for rotation and position but it is misleading for scale. The TransformManager scale warps the ContentDisplay. When the ContentDisplay scaleMode is set to Stretch this makes perfect sense but when the ContentDisplays scaleMode is set to either of the Proportional settings it seems like it should change the bounding box width instead. That way the image continues to fill maintain proportion according to the scaleMode. I attempted the TransformManagers constrainScale and this guarantees that the original fitHeight and fitWidth aspect ratio are maintained which helps in the cases where the scaleMode is set to proportional but sacrifices the ability to change the shape of the bounding box. I guess that is my question: Is there a way to make the TransformManager change the ContentDisplay bounding box? Thoughts, feelings, assistance?
  11. Adobe just release 11.2 of the flash player that appears to really mess up the seek function on netstream objects. I didn't delve very far into the issue but I wrote a little test app to confirm the issue. I have attached the project to help. The summary is that I tested seeking to each frame of a video in a loop and got the following results: ----------------------------------------------------- flash version: MAC 10,3,183,18 ----------------------------------------------------- complete - ready to loop through seek on 1273 frames starting seek through video at: 4614 ending seek through video at: 4617 total time: 3ms starting seek through video at: 6907 ending seek through video at: 6910 total time: 3ms starting seek through video at: 9134 ending seek through video at: 9137 total time: 3ms starting seek through video at: 11349 ending seek through video at: 11353 total time: 4ms ----------------------------------------------------- flash version: MAC 11,1,102,64 ----------------------------------------------------- complete - ready to loop through seek on 1273 frames starting seek through video at: 4288 ending seek through video at: 4291 total time: 3ms starting seek through video at: 6560 ending seek through video at: 6563 total time: 3ms starting seek through video at: 7045 ending seek through video at: 7048 total time: 3ms starting seek through video at: 7752 ending seek through video at: 7754 total time: 2ms ----------------------------------------------------- flash version: MAC 11,2,202,228 ----------------------------------------------------- complete - ready to loop through seek on 1273 frames starting seek through video at: 2528 ending seek through video at: 3443 total time: 915ms starting seek through video at: 5690 ending seek through video at: 6629 total time: 939ms starting seek through video at: 8136 ending seek through video at: 9064 total time: 928ms starting seek through video at: 10419 ending seek through video at: 11347 total time: 928ms Hope this helps.
  12. Better yet I am extending the class in order to dispatch an update event and hooking onto that. You might consider this as an alternative feature request.
  13. Couldn't hurt to ask. I am doing option 1 but I have to completely override the _update call so I am essentially copying that function and then removing that piece. A little easier than merging but still with the some maintenance concerns. #2 is undesirable for a slew of reasons that are unique to my situation. Anyhow, thanks for the fast reply.
  14. Hi Jack, I'd like to make a feature request for the FlexContentDisplay & ContentDisplay classes. In your _update call you are drawing a, normally transparent, rectangle: protected function _update():void { var left:Number = (_centerRegistration && _fitWidth > 0) ? _fitWidth / -2 : 0; var top:Number = (_centerRegistration && _fitHeight > 0) ? _fitHeight / -2 : 0; graphics.clear(); if (_fitWidth > 0 && _fitHeight > 0) { graphics.beginFill(_bgColor, _bgAlpha); graphics.drawRect(left, top, _fitWidth, _fitHeight); graphics.endFill(); } I remember something from the docs about this being to insure mouse interactions would function properly. My request is to have a var that tells it *not* to do this. I would like to draw these backgrounds myself but updates were interfering. I extended the class but it sure would be nice to not have to check/maintain it each time I update my greensock. My thoughts are something like: protected function _update():void { var left:Number = (_centerRegistration && _fitWidth > 0) ? _fitWidth / -2 : 0; var top:Number = (_centerRegistration && _fitHeight > 0) ? _fitHeight / -2 : 0; if ( !manualBg ) { graphics.clear(); if (_fitWidth > 0 && _fitHeight > 0) { graphics.beginFill(_bgColor, _bgAlpha); graphics.drawRect(left, top, _fitWidth, _fitHeight); graphics.endFill(); } } With the appropriate getters and setters for manualBg. I can pass along what I have done if you like but I assume you'd like to do it your own way. Thanks! Sam
  15. Thanks for the info Jack, I'm not complaining, just trying to understand where my time is going. It does look like the profiler must include the netstream in their [tincan]. I profile my app without videos and the [tincan] method goes away. I have gone through a bunch of optimization and have managed to increase the [tincan]s consumed time to around 80%. In some cases the app is trying to play 3+ videos simultaneously maintaining some sync so it's no big surprise that load for decompression would be high. BTW, I am highly disappointed in the lack of low level hooks that the netstream gives for operating between iframes. I would have expected a step operation there. Another glaring hole seems to be a settable FPS. Everything my research has turned up thus far in these areas looks like these *might* be possible if I am willing to invest in a FMS and only handle content that I serve from there.
×
×
  • Create New...