Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
-File -> New... (CTRL+N) -> Flash Document (so, just what you would do normally) -> Ok.
-Click on frame1 on layer1 to select it.
-Window -> Components (CTRL+F7) -> FLV Playback - Player 8 -> FlvPlayback -> doubleclick -> you can exit the components window if you please.
-Leftclick on the component.
-Activate the parameters tab.
-Change the 'contentPath' to the location of your flv. Make sure the 'Match source file dimensions' box is checked.
-Change the 'skin' to 'none' or what you prefer.
-Activate the Properties Tab.
-Modify -> Document... (CTRL+J) -> change the default demensions: W(idth) and H(eight) to the values inside the properties window. -> Change the Frame Rate to the same of your movie, ex. 25 fps -> Ok
-Change both the X and the Y in the properties tab to 0.
Scripting
-Select frame1 on layer1.
-Window -> Actions (F9) -> paste alle script
//create an empty var, ready for XML content.
var xmlContent:XML = new XML();
//ignore empty elements like instead of
//formatting them to etc.
xmlContent.ignoreWhite = true;
//the first frame is the first frame where the movie starts playing..
//so start with index 0
i = 0;
//every frame in the flash file is a frame of the flv movie because we synched those
//so we can change the cooords of the animation in refference
//to the coords in the xml file each time the flash file enters a new frame
onEnterFrame = function () {
//The flv might be playing before the xml is loaded but shit happens
if (xmlIsLoaded == true) {
//if the animation is out of synch with the flv..
offset = -Math.round(25/2);
//assign the framenumber to a variable
newNumber = xmlContent.firstChild.childNodes[3].firstChild.childNodes[i+offset].childNodes[0].firstChild.firstChild.nodeValue;
//assign the new x cooord to a variable
newX = xmlContent.firstChild.childNodes[3].firstChild.childNodes[i+offset].childNodes[1].firstChild.firstChild.nodeValue;
//assign the new y cooord to a variable
newY = xmlContent.firstChild.childNodes[3].firstChild.childNodes[i+offset].childNodes[2].firstChild.firstChild.nodeValue;
//if there are still framenumbers in the xml file then actualy give the movieClip it's new position
if (newNumber != undefined) {
theMovingObject._x = newX;
theMovingObject._y = newY;
//Track(newNumber+","+newX+","+newY);
}
}
//Increment the number with one for each time a frame is entered.
i++;
};
//If the xml file is loaded into flash then...
xmlContent.onLoad = function(loooaded:Boolean) {
if (xmlContent.hasChildNodes()) {
//Only start doing things with the xml when it's loaded already,
//else we're only going to get a big pile of nonesence and maybe bugs.
xmlIsLoaded = true;
//As you might have seen or not, there is a pile of useless thingies
//in the xml file, so when the xml is loaded
//get rid of the useless elements in it.
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.firstChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.lastChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.lastChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.lastChild.removeNode();
xmlContent.firstChild.childNodes[3].firstChild.lastChild.removeNode();
} else {
//If the file is unreadable, then let me know
//there is a big chance that you missed my note earlier in my tutorial
//about that new-versions-of-excel xml thingy.
Track("XML loading-errorblah");
}
};
//Start loading the xml file wherein we'd put all
//coordinates and stuff from After Effects
xmlContent.load("07positions.xml");
-Create a movieclip called 'theMovingObject' with your object in it. Like the icecube or the helmet with the propellor on it in the examples I brought up earlier.
-Insert -> New symbol(CTRL+F8) -> make it available for actionscript.
-Make sure it also has the instance name 'theMovingObject'.
And that's it! Sort of... =) hope it was of 'some' use.