coder and technology lover
ImageNavigator
ImageNavigator is a custom Flex component, composed by a set of classes, which offers navigation features similar to navigators you can find in image editing software like Photoshop.
It’s easy to use and does all the work for you, all you need to do (once you get the zip file available at the bottom of this page) is:
- put the folder “com” under src folder in your Flex project
- create a new XML namespace in your Application: xmlns:doc=”com.daveoncode.ui.*” (this is not necessary if you will use ImageNavigator with Actionscript)
- create a Canvas with an Image inside
- create a new ImageNavigator object specifying the “image” attribute by using a reference to the previously created image
By default ImageNavigator will use vertical and horizontal scroll position of the canvas to adjust thumb’s pointer position, however you may want to move your image by dragging it (code implementation is up to you), in this case is possible to set the attribute “useImageXY” to true in order to get the right behaviour from the component (anyway a look to the source code will help you understand what I’m talking about).
Important:
Due to security restrictions imposed by Flash player you can load images from any site but can’t access their BitmapData. Unfortunately ImageNavigator need it to create the proportioned image thumb and won’t works otherwise, unless to use crossdomain.xml files (read more here http://livedocs.adobe.com/flex/3/langref/mx/controls/Image.html ).
License:
This component is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
You may obtain a copy of the License at: http://creativecommons.org/licenses/by-sa/3.0/
Here is it in action:
The Flash plugin is required to view this object.
Documentation
The asdoc is available here:
http://www.daveoncode.com/_docs/image_navigator/com/daveoncode/ui/ImageNavigator.html
Get it!
You can download ImageNavigator here: http://www.daveoncode.com/_dave_stuff/flex_components/ImageNavigator.zip
27, Thursday f, 2009 - 2:24 am
Nice example…
18, Friday f, 2009 - 2:00 pm
This is great. Good job!
27, Tuesday f, 2009 - 9:10 am
Great example, thanks! I tried to use the useImageXY=”true” option like this:
doc:ImageNavigator image=”{image1}” width=”154″ height=”150″ useImageXY=”true”
But it worked the same as your top example. Could you provide the code you used to do the bottom example?
27, Tuesday f, 2009 - 9:21 am
Hi JJ! You could see the code by right clicking on the Flex app (anyway this is the source: http://www.daveoncode.com/_dave_stuff/flex_components/ImageNavigator.mxml).
In order to use image X and Y you must implement the drag logic by yourself (using startDrag() and stopDrag()), then the component will update the navigator thumb according to image position
11, Thursday f, 2010 - 11:47 pm
I can use this as mapping development. I have an old bad-ended project. This would definitely help me to zoom in and out by plugin the TweenMax section. Come visit my web by the way.