Jump to content
Search Community

MDiddy

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MDiddy's Achievements

1

Reputation

  1. Just in case anyone else is looking for something similar, I did find JS Library that offers similar functionality through the HTML5 Canvas tag: Fabric.js Javascript Canvas Library Its a bit clunky but its got a lot of the basic functionality you'd need to get started. Obviously doesn't have the spit-polish that Greensock has - but so far I've been impressed.
  2. Hi Jack, Just wondering if you had any plans on creating a JS equivalent to TransformManager in addition to the newly released Tween library. Thanks!
  3. I started playing with Flex Crop for a mobile app I'm building and ran across something that I think may be useful for others. Forgive me if I overlooked something existing in the API... I need to give users the ability to pick an area of their photo to crop to use as a thumbnail image. But there didn't appear to be a way to define a desired rect size for the crop. The crop box seemed to only be able to default to full size of the image. I was able to constrain the scale using of the crop box using the transformManager's constrainScale, but I couldn't find a way to provide a desired rect for the crop box itself. After digging through the class I was able to make a couple of small mods that seem to work in my instance: //Will be used to store the preferred default rect positioning protected var _cropBounds:Rectangle; //In the constructor public function FlexCrop(target:DisplayObject, manager:TransformManager, attached:Boolean=true, fillColor:uint=0x000000, alpha:Number=0, cropBounds:Rectangle = null) { _cropBounds = cropBounds; } //Replaced the first line of _calibrateBox() with: var bounds:Rectangle = _cropBounds?_cropBounds:_target.getBounds(_target); Hope its helpful to someone else
  4. Hello is there a recommended workaround for this? I'm using Flex 4.6 and getting the same problem. According to Adobe: "Use of the low-level getBounds is not recommended in UIComponents. It will factor in hidden display objects." http://forums.adobe.com/message/4146856
  5. Hey everyone, I'm wondering if anyone's ever run across a class or component that will create an effect while a total is being calculated....I have to make a server call to get a value and while that's happening, I want to display a string of random numbers of a set length until the value comes back. I googled and didn't come up with anything and figured I'd ask before rolling up my own. Thanks!
  6. I wouldn't call myself a seasoned vet at all. But I've been sort of monkey patching FlexTransformManager so far to do a proof of concept but sure I'd be happy to give it a go. I started using Flex back in with version 2.0 so I can certainly feel your pain. I avoided it unless absolutely necessary. But starting with 4.0 and the new Spark components, I"ve found that component development is much more predictable. They're much more composition-oriented than the Flex 2/3 world.
  7. Hi, Just wondering if you're planning on updating the TransformManager component for the latest Flash Builder updates? It seems like it extends Canvas, which isn't available for mobile devices in 4.5.1. The halo components are deprecated anyway so I just wanted to know if its on your radar? Thanks for a fantastic set of tools!
  8. Wow thanks alot for this. I knew it had to be simpler than I was imagining. A couple of wrinkles I'm trying to overcome now: Adding curved segments to the path Using a dashed line for part of the path I tried incorporating this class: http://sebastian.formzoo.com/2010/11/06 ... s-for-as3/ for dotted lines, but since its based on making its own sub lines, the path just comes out looking solid. I switched around your code a bit to run the onUpdate inside of each individual tween so that I could pass params for each segment. I assumed by moving the onUpdate to the individual tweens, I get the bezier values as they change, but the more I think about it - I may need to add a couple more points and adjust some of these values to get a curve parts to show: //XML to describe path: /* */ //_points is an array of objects that represent this data. // I have a setter for the points array in my custom class: public function set points(value:Array):void { clearPath(); _points = value; t.data = value; for (var i:uint = 0; i<_points.length; i++) { var vo:Object = _points[i] as Object; //vo.isSolid:Boolean that identifies whether the segment is a solid line //vo.dotted:Array (Array of dashes/gaps for the DottedLine class) if(vo.isBezier) { t.append(TweenMax.to(dot, vo.duration, {bezierThrough:[{x:vo.pt.x, y:vo.pt.y}], onUpdate:drawSegment,onUpdateParams:[vo.isSolid, vo.dotted]})); } else { t.append(TweenLite.to(dot,vo.duration, {x:vo.pt.x, y:vo.pt.y, onUpdate:drawSegment, onUpdateParams:[vo.isSolid, vo.dotted]})); } } } private function drawSegment(solidBool:Boolean, dottedArray:Array):void{ if(isSolid) { path.graphics.lineTo(dot.x, dot.y); } else DashedLine.setDashes(dottedArray); DashedLine.lineTo(path.graphics, dot.x, dot.y); } }
  9. Hi I'm looking for a little direction here. I'm not a big animator and I'm creating a map with a few points of interest and I want to animate the route connecting these points. Obviously its a little tricky because the route has to follow certain roads. The map isn't going to be used for navigation purposes so it doesn't need to be super exact. Just wondering what the best approach is to start? I was looking at bezierThrough but it seems like thats more for moving an object rather than highlighting a path. Any suggestions would be great Thanks!
  10. Very sorry I probably shouldn't try to articulate questions that late at night. Thanks for bezierThrough suggestion. I'll do some experiments to see if I can get a satisfying effect. For my randomizer question, I know this is outside of the scope of TweenMax but I figured someone may have had to do something similar when creating an animation. I need to get random unique points inside of a circle to don't overlap any other shapes inside the circle. The shapes will be snowflakes all the same default size, but may be slightly scaled/blurred depending on their depth. I can get random points inside a circle using this: public static function getRandomPoint(radius:Number):Point { // fetches a random point within this circle radius var p:Point = new Point(); var a:Number = (Math.random()*360); var r:Number = (Math.random()*radius); p.x = Math.cos(a * Math.PI/180) * r; p.y = Math.sin(a * Math.PI/180) * r; return p; } What I can''t seem to figure out is how to ensure that the random points aren't too close to each other. I figured I could iterate through an array of points and check each new random point against the array but I can't wrap my head around how I need to set it up. Hopefully that's a little easier to understand. Had my morning coffee
  11. The default ease for a Tween is an easeOut. But you can change to a constant speed by changing the ease property: TweenLite.to(mc, 1, {y:300, ease:Linear.easeNone}); Hope that helps
  12. Hey everyone I'm Trying to nail down a tween for an effect and I could use a little help. Basically, I'm trying to get an effect similar to a snow globe where a flake would slowly fall slighty influenced by wind. The wrinkle is that my flakes are buttons and have to generally stay where they area but instead just hover and spin and all axis. I've also been trying to create a randomized that will get a point that's unique where the shapes don't overlay within a circle. I've got the randomized working to get a random point inside a circle but the returned points just dont seem random enough as they frequently overlap. Any thoughts on either issue are really appreciated. Thnk you!
  13. Hey everyone, I've been looking through the ASDocs and forgive me if I'm overlooking it, but I was wondering if there is an event dispatched for VideoLoader's playback progress? I'm using an enterFrame for now. Thanks!
  14. Hi I'm probably doing something wrong but I can't seem to come up with the correct way to do this. I have a timeline app that I'd like to LoaderMax because it seems like it would take a ton of the hassle out of loading all the assets necessary. I have a bunch of png slices that I compose to build out most of the visuals. There are four layers of assets that slide at slightly different rates so I grouped each layer as its own LoaderMax object. My goal was to load each part (ImageLoader) then arrange them, one after the other. Here's my problem: When I use a width attribute with ImageLoader nodes, I get a compile error: ArgumentError: Error #2004: One of the parameters is invalid. at flash.display::Graphics/drawRect() at com.greensock.loading.display::ContentDisplay/set loader() at com.greensock.loading.display::ContentDisplay() at com.greensock.loading.core::DisplayObjectLoader() at com.greensock.loading::ImageLoader() at com.greensock.loading::XMLLoader$/parseLoaders() at com.greensock.loading::XMLLoader$/parseLoaders() at com.greensock.loading::XMLLoader$/parseLoaders() at com.greensock.loading::XMLLoader/_receiveDataHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Is this the best practice? How can I avoid this error?
  15. I basically tried using the code form the forum post I linked to, but the sort order still seems to be off. private function bringForward():void { flexTransformManager.moveSelectionDepthUp(); sortBoard(); } private function sendBackward():void { flexTransformManager.moveSelectionDepthDown(); sortBoard(); } private function sortBoard():void { var clips_array:Array = flexTransformManager.targetObjects; var newArray:Array = []; for (var i : int = 0; i < clips_array.length; i++) { clips_array[i].vo.itemDepth = i; trace(i, flexTransformManager.getChildIndex(clips_array[i])); newArray.push({depth: flexTransformManager.getChildIndex(clips_array[i]), item:clips_array[i]}); } newArray.sortOn("depth", Array.NUMERIC); var arrangedArray:Array = []; for (var j:uint = 0; j < newArray.length; j++) { arrangedArray.push(newArray[j].item); } //Objects are still not in the correct order in arrangedArray; }
×
×
  • Create New...