The tool rotates a sequence of images. If you take e.g. 72 photos of a product in 5deg steps, you get a nice 360deg view of the product.
Preloader
Rotation
User Control
Zooming
Theming
Hotspots
Other Features
Images count
Maximum Image resolution
Flash player version
Flash CS3 required for editing or resizing a theme
Some flash knowledge is required
Size of the movieclip can not be set in the html code
You need the images of the object you want to present. For a smooth animation at least 72 images are required (one image for every 5 degrees of a full 360 degree turn). If you are not sure how to do it, check the Getting the Images chapter. Put the images in a single folder named e.g. images.
You can use the Config Utility to create the config.xml. For experienced users it is sometimes faster to edit the config.xml file directly. The one really important thing about config.xml is to specify path to the images:
<images>
<image src="images/02.jpg" />
<image src="images/03.jpg" />
<image src="images/04.jpg" />
...
So e.g. replace images/02.jpg from the demo example with images/myshot0001.jpg where myshot0001.jpg is your image.
Once you have the config.xml file ready, place it together with the images folder into a common folder named e.g. with the name of your product. The directory structure might look as follows:
backpack [folder]
- config.xml
- images [folder]
- myshot001.jpg
- myshot002.jpg
- myshot003.jpg
Remember, the Config Utility can help you to create the config.xml file.
Using Adobe's code:
PHP helper function to generate this Adobe's code:
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
"codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",
"width", "500",
"height", "375",
"src", "rotateTool",
"quality", "high",
"pluginspage", "http://www.macromedia.com/go/getflashplayer",
"align", "middle",
"play", "true",
"loop", "true",
"scale", "noScale",
"wmode", "window",
"flashVars", "path=backpack",
"devicefont", "false",
"id", "multi",
"bgcolor", "#FFFFFF",
"name", "rotateTool",
"menu", "true",
"allowFullScreen", "false",
"allowScriptAccess","always",
"movie", "rotateTool",
"salign", "lt"
); //end AC code
}
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="rotateTool" width="500" height="375"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="rotateTool.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowScriptAccess" value="always" />
<param name="flashVars" value="path=backpack" />
<param name="scaleMode" value="noScale" />
<embed src="rotateTool.swf" quality="high" bgcolor="#FFFFFF"
width="500" height="375" name="rotateTool" align="middle"
play="true"
flashVars = "path=backpack"
loop="false"
quality="high"
scaleMode="noScale"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
Using the swfobject to embed flash movies into a website:
<script type="text/javascript" src="swfobject21.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.path = "backpack";
var params = {};
params.scale = "noScale";
params.salign = "lt";
params.allowScriptAccess = "always";
var attributes = {};
attributes.id = "myFlash";
attributes.name = "myFlash";
swfobject.embedSWF("rotateTool.swf", "flashContent", "500", "375", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
<div id="flashwrapper" style="width: 500px; height: 375px;">
<div id="flashContent">
Detecting Flash
</div>
</div>
The most important line is the flashvars.path = “backpack”; Here you specify the path to the config.xml file. The tool looks for config.xml in the backpack folder. This way you can use one swf for any number of products.
This is the list of all available flashVars:
In 90% of cases you set only the path variable. However you can use any of the other specified ways to tell the tool where to look for the images. To sum it up, you set one of the following:
so setting e.g. both path and dataFile is wrong
This section is for experienced Flash Users who know ActionScript.
The rotate tool is initialized using ActionScript. You create a the rotate tool instance issuing this command:
Note: you can find this commands in actions of the first frame in the downloaded demo .fla files
var rotateTool : RotateToolApp = new RotateToolApp(rotateToolTheme);
rotateToolTheme is the name of the movieClip instance on the stage, which does contain the theme assets.
You start the tool with this command:
rotateTool.start();
If you want to remove the tool from the stage and memmory, use this command:
rotateTool.release();
Other commands:
rotateTool.showErrors = false;
If set before calling the start() command, the error reporting is turned off.
rotateTool.setImage(7);
Displays the image with provided id. For example id 7 is the eighth image in the config.xml.
rotateTool.setNewPath("/otherproduct/");
Removes the loaded images and loads new images specified by the path parameter. See Available FlashVars chapter for more details on the path parameter.
rotateTool.setNewDataFile("otherFile.zip");
Removes the loaded images and loads new images specified by the dataFile parameter, when using zip file instead of images + config.xml;
Other commands:
rotateTool.stopRotation(); stops the rotation rotateTool.startRotation(); starts the rotation rotateTool.disableControls(); disables button & mouse control rotateTool.enableControls(); enables button & mouse control
rotateTool.zoomOut();
Zooms out if the tool is zoomed
rotateTool.getActualImage();
Returns id of currently displayed image. The first image in config.xml has the id 0.
It is possible to set the dataFile or path before the start() command is issued, in case you don't want to use the flashVar parameters (e.g. in the case the rotateTool is a part of a larger project.)
use:
rotateTool.path = "/otherproduct/";
or:
rotateTool.dataFile = "product007.zip";
then:
rotateTool.start();
to “hard code” the path to the images in the swf.
EVENTS
You can add eventListeners to the rotateToolApp instance and listen for various events. Currently these events are avaiable, example:
var rotateTool = new RotateToolApp(rotateToolTheme); rotateTool.path = myPath; rotateTool.addEventListener(RotateToolApp.INITIALIZED, rotateToolInitialized); rotateTool.addEventListener(RotateToolApp.LOADING_PROGRESS, progressListener); rotateTool.addEventListener(RotateToolApp.HOTSPOT_CLICK, hotspotClickListener ); rotateTool.addEventListener(RotateToolApp.HOTSPOT_OVER, hotspotOverListener); rotateTool.addEventListener(RotateToolApp.HOTSPOT_OUT, hotspotOutListener);
INITIALIZED
Is dispatched when all images are loaded. Event type is flash.events.Event
LOADING_PROGRESS
Informs on how many images are loaded – useful e.g. for your custom preloader. Event type is com.yofla.rotateTool.events.CustomEvent and it has a property “obj” which holds a number from 0 to 1.
HOTSPOT_CLICK
Is issued when a hotpsot is clicked. Event type is com.yofla.rotateTool.events.HotspotEvent. Event has a property hotspot with some public data, the most important is hotspot.xmlData – it is the xml data of the hotspot as specified in the config.xml. Other public properties of the HotspotEvent are counterparts of attributes specified in the xml, e.g. hotspot.offsetX is the specified (or inherited) offsetX attribute.
HOTSPOT_OVER
Is triggered when the mouse mouse-overs the hotspot
HOTSPOT_OUT
Is triggered when the mouse mouse-outs the hotspot
It is possible to zip the images and config.xml into one .zip “datafile”.
Advantages and disadvantages of using a zip datafile over Xml file + images:
Advantages of using the .zip datafile:
Disadvantages of using the zip datafile:
Advantages of using images + xml file
Disadvantages of using images + xml file
For most of my project I prefer using the xml + images approach. This has the advantage that you can edit the xml really fast and you can also update the images fast - without the need of repacking the zip file. My usual work flow is that I create the set of images and config.xml using the config utility and then I just edit the config.xml to adjust speed, user interface look, or add/modify the hot-spots.
You configure the tool via settings specified in the config.xml. You can use the Config Utility to create the xml or you can edit it directly.
If you have shoot the images of rotation for more horizontal levels, you set the data in the <multidirectional> node attributes:
It is possible to set default settings for the images and hotspots:
Example:
<defaults>
<image showDescription="true" showHotspots="true" showTitle="true" shrinkToFit="true" zoomToFit="true" />
<hotspot height="100" showTitle="true" type="rectangle" width="100">
<border color="FF0000" type="solid" width="2" />
</hotspot>
</defaults>
Image attributes:
Hotspot attributes and sub-nodes:
- Please see the description of the hotspot and border nodes further in the manual.
- If you define the default settings here, all hotspots will use them unless a hotspot overrides some of the settings.
IntroImages node is a collection of images which display once before the rotation. They are useful for an intro-animation you want to display before the rotation starts. If you do not define this node, no intro images are shown. <introImages> node attributes are:
In the hotspots node you define the hotspots. Each hotspot has an id attribute. Once a hotspot is defined, you can assign it to any of the images.
Hotspot node example:
<hotspots>
<hotspot id="newCustomExample"
type="custom"
className="MyCustomHotspot"
absolutePosition="true"
offsetX="330" offsetY="230" >
<image src="images/other/zoom.jpg"
title="Custom hotspot example"
showDescription="true">
<description>
<![CDATA[With 3D Rotate Tool 4.4.0 and above, you can define custom
hotspots as movieClips in the library. See manual for details.<br><br>]]>
</description>
</image>
</hotspot>
</hotspots>
In the above example we define an image or close-up hotspot. We did it by providing the <image> subnode. The hotspot has these attributes:
After a close-up hotspot is clicked, an image is loaded and optionally it's title/description is displayed. You can nest the close-up hotspots.
Example:
<hotspot id="newCustomExample"
type="custom"
className="MyCustomHotspot"
absolutePosition="true" offsetX="330" offsetY="230" >
<image src="images/other/zoom.jpg" title="Custom hotspot example" showDescription="true">
<description>
<![CDATA[With 3D Rotate Tool 4.4.0 and above, you can define custom hotspots as movieClips
in the library. See manual for details.<br><br>]]>
</description>
</image>
</hotspot>
Image node attributes are:
Image node subnodes are:
<description> <![CDATA[string]]> </description>
Contains description of the image for close up image.
<title>
<text><![CDATA[This is<br>a test.<br>Multiline]]></text>
</title>
It is possible to specify custom hotspot title text (which displays on hotspot mouse over) for ImageHotspot. If no hotspot title text is specified, the image title text is used as before.
Represents the Flash Zoomer hotspot. If clicked a larger image is loaded which can be zoomed in and out. Due to Flash player limitation the loaded image can be of 2880px in widht or height maximum.
<zoom> node attributes:
Example:
<hotspot id="zoom" type="rectangle" width="40" height="30">
<border type="double" color="0000FF" color2="FFFFFF" width="1" />
<zoom src="images/other/zoom.jpg" title="Zoom detail"/>
</hotspot>
Represents the URL hotspot. If clicked, an http link is opened.
<url> node attributes:
Example:
<hotspot type="disc" showTitle="true" radius="20">
<border type="double" color="FF0000" color2="0000FF" width="2" />
<url src="http://www.yofla.com" title="YoFLA Homepage" target="_blank" />
</hotspot>
Represents the JavaScript hotspot. If JavaScript hotspot is clicked a defined JavaScript function is called. Example: http://blog.yofla.com/2010/03/3d-rotate-tool-javascript-hotspot-example/
<javascript> node attributes:
Example:
<hotspot id="javascripthotspot" type="custom" className="MyCustomHotspot" showTitle="true">
<javascript command="myJavascriptFunction" attribute="This is a test!" title="JavaScript Hotspot Example">
</javascript>
</hotspot>
After a hotspot is clicked, a movieClip is loaded.
Example:
<hotspot id="newExample"
type="custom"
className="MyCustomHotspot"
absolutePosition="true"
offsetX="330"
offsetY="230" >
<movieclip src="images/other/mchotspot.swf" title="Some Title" />
</hotspot>
If you use the disc, circle or rectangle type of the hotspot you can define the look of the hotspot using the border node. Example:
<hotspot id="zoom" type="rectangle" width="40" height="30">
<border type="double" color="0000FF" color2="FFFFFF" width="1" />
<zoom src="images/other/zoom.jpg" title="Zoom detail"/>
</hotspot>
border node attributes:
Images node is the core of the config.xml file. It contains the images which make the 3D animation of your product. The images node contains an <image> node for every image in the animation. Each image node can have unlimited number of hotspot nodes.
Example:
<image src="images/Img0215.jpg" >
<hotspot source="absoluteHotspot" />
<hotspot source="closeup" offsetX="357" offsetY="92" />
<hotspot source="zoom" offsetX="145" offsetY="350" />
</image>
Is an air application which facilitates creating the config.xml file:
You need to install Adobe Air Runtime first: http://get.adobe.com/air/
Then you can download the Config Utility for 3DRT here: http://www.yofla.com/down/3d-rotate/config-utility/ConfigUtility.air
There are two ways how to get images for your product presentation. One is the good old fashioned photography, the other are Computer Generated Images (CGI).
Depending on your budged, you can use services of an professional or shoot the photos by yourself. When shooting images by yourself you will need good lighting and a turntable. Here are some external links on this topic:
Making a turntable:
Studio Lighting:
Excellent guide on how to take photos on a turntable: * http://beckerexhibits.wustl.edu/3D/howto/index.html
This are just few links for your inspiration, there are more useful tutorials on the net on studio-lightning.
In some cases a viable alternative to photographs are CGI images. If you have no experiences with CGI software, I recommend outsource this task to a professional.
If want to try to create the CGI images by yourself, there is the best free (and open-source) program Blender3D http://www.blender.org/
From the paid software my favorite is Cinema 4D, but there are many others as 3D Studio MAX, Lightwave, Maya and others…
I cooperate with CGI professionals so if you decide to go with CGI images you can contact me at info@yofla.com
The 3d rotate tool.v4 came with a new theming approach. You can set any position of the ui elements or of the rotated images. The disadvantage of this approach is that you can't scale the final swf. If you have designed your theme to be 500x400px, you can't change the swf's width and height to other values in the html code.
The best way how to create a new theme is to start modifying a current one. It is important that the instance names of the movies on the stages do not change, otherwise the tool will stop working.
In many cases the the tool scans for the width and height of the instances on the stage. Because of this you need to set their width or height by editing their content and not by scaling them. Their x and y scale must stay 100%.
The rotateToolTheme movie which you edit has many layers. Hide layers you don't need fore easier editing.
A video tutorial is also available: http://www.yofla.com/flash/3d-rotate/tutorials/blackDiamondResize.html
Here follows a simple description of each layer and how to modify it:
Background Layer
Images layer / movie
Controls layer
Preloader layer
Image Plugin Layer
FlashZoomer Plugin Layer
Hotspot layer
Cursors layer