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:
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
about 1 year ago
Nice example…
about 11 months ago
This is great. Good job!
about 10 months ago
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?
about 10 months ago
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
about 6 months ago
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.
about 3 months ago
Is there anyway to use this with a UIComponent rather than an image?
about 3 months ago
Unfortunately is not possible, it will need an heavy code refactoring :P
about 3 months ago
Hi,
nice comp. How can i implement the showZoomSlider ?
Thanks in advanced.
about 3 months ago
Sorry, i see. tx