On this page
Use Javascript to interact with Flash
How to Build a Car Rig in 3ds Max
Car Rig Tutorial - 3ds Max and Reactor
Creating Dynamic RSS Feeds in PHP
How to Build a Car Rig in 3ds Max
Car Rig Tutorial - 3ds Max and Reactor
Creating Dynamic RSS Feeds in PHP
Tag cloud
javascript kitchen css render web update bbc interaction loops car video match mysql car rig composite demo reel camera intro scripting 2009 dragon machines earth demo blackjack silverstone eurofighter black hawk environment directx interior meteor matrix ford actionscript interactive red bull texture robotic ball site reactor city map anticipation tutorial bullet time l4d special effects vehicle skinning lego
Categories
Featured work
Finished animations
Interactive features
Maps and mods
Work In progress
Character animation and loops
Images
Site news and updates
Tutorials
Random blog posts
Uncategorised
Finished animations
Interactive features
Maps and mods
Work In progress
Character animation and loops
Images
Site news and updates
Tutorials
Random blog posts
Uncategorised
Most popular
How to Build a Car Rig in 3ds Max
Car Rig Project - 3ds max - Updated
Unreal Tournament 3 - UT3 - City Project
Car Rig Tutorial - 3ds Max and Reactor
Motorway and Foliage - Grass
Car Rig Project - 3ds max - Updated
Unreal Tournament 3 - UT3 - City Project
Car Rig Tutorial - 3ds Max and Reactor
Motorway and Foliage - Grass
Archive
August 2010 [1]
July 2010 [3]
June 2010 [4]
May 2010 [3]
April 2010 [3]
March 2010 [3]
February 2010 [6]
January 2010 [1]
October 2009 [2]
September 2009 [3]
August 2009 [4]
July 2009 [2]
June 2009 [3]
May 2009 [1]
April 2009 [7]
March 2009 [2]
February 2009 [3]
January 2009 [3]
December 2008 [4]
November 2008 [1]
October 2008 [7]
September 2008 [3]
July 2008 [1]
July 2010 [3]
June 2010 [4]
May 2010 [3]
April 2010 [3]
March 2010 [3]
February 2010 [6]
January 2010 [1]
October 2009 [2]
September 2009 [3]
August 2009 [4]
July 2009 [2]
June 2009 [3]
May 2009 [1]
April 2009 [7]
March 2009 [2]
February 2009 [3]
January 2009 [3]
December 2008 [4]
November 2008 [1]
October 2008 [7]
September 2008 [3]
July 2008 [1]
Blog
"tutorial"
Items tagged with tutorial:
Use Javascript to interact with Flash
JUN
Click me!I've now redesigned my portfolio page, and as a result there's no space for this little feature, so I'm going to write about it instead and give the example.17
2010
It's a handy way of having extra interaction on the web page, by allowing a nice little animation every time a link is clicked. I was using a jQuery plugin to load content dynamically, and it gave me the idea that because the rest of the page outside of the target div is static, it would be good to have a small animation. So each time the page swapped from one section to another, this little guy pressed the button.
The Javascript used is pretty much the same as that found at Permadi. Just copy that code and stick it in some 'script' tags:
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
This allows the browser to communicate with Flash. Next, it needs to be told what to tell Flash once the command is given. In my case, my Flash file was looping between frames 60 and 111, once the initial part of the animation (lasting 60 frames) had finished, so I wanted a 'gotoAndPlay(112) command:
function PlayFlashMovie()
{
var flashMovie=getFlashMovieObject("robot");
flashMovie.GotoFrame(112);
flashMovie.Play();
}
Note that I have called the Flash file 'robot', and this needs to be defined above. To display the
AC_FL_RunContent( "codebase","http://download.macromedia.com /pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0","width","312","height","250","src","flash/robot","wmode","opaque", "allowfullscreen","true", "quality","high", "pluginspage","http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash","movie","flash/robot", "swliveconnect","true", "name","robot" );
This method of displaying Flash is probably quite out of date, but it works and doesn't produce errors as far as I know.
Finally, add a button, just a standard 'a' link and include the onClick action:
onclick="playFlashMovie();"
And that's it! Your Flash movie should now gotoAndPlay frame 112. You just have to be careful to design your animation so that if someone goes crazy and keeps clicking, it still looks OK. And if it's in a loop as mine is, that it doesn't matter from which frame of the animation it jumps from. You should add in an extra bit to the Flash telling it to trigger a certain animation once it reaches the happy frame though. Now if only Flash worked on Apple devices...
Credit for the code goes to Permadi.com.
Click me!
Car Rig Tutorial - 3ds Max and Reactor
APR
13
2009
First, create a cylinder with radius 10 and height 1. Increase number of sides to 36 to make the motion a little...
Creating Dynamic RSS Feeds in PHP
APR
12
2009
I'll assume you have content being fed from an...