Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display frame number

Status
Not open for further replies.

xpher

Programmer
Oct 4, 2003
4
GB
Hi

New to flash etc. Am using javascript to control my flash movie. Been trying to display the frame number as the movie is playing (without clicking or hovering). Is there any way to do this and keep updationg frame number in an input box say? I know it will be too fast to read but just trying things out
 
Tried that. Can get it to work to display frame number at the moment of clicking button but what I want is for the html input to show frame number continuously as movie playing. Almost like a counter I suppose.
 
That's what my suggestion does. Flash triggers Javascript function on every frame, the number is updated automatically. There's no need for a button or anything.

Do you need a code example?

Kenneth Kawamoto
 
An example would be a help. Don't know whether some of my problem is to do with trying to maintain unobtrusive javascript. Cheers
 
ActionScript
Code:
this.onEnterFrame = function():Void  {
	getURL("javascript:displayFrameNum("+_currentframe+")");
};

JavaScript
Code:
function displayFrameNum(num){
	document.getElementById("frameNum").innerHTML = num;
}

HTML
Code:
<div id="frameNum"></div>



Kenneth Kawamoto
 
Thanks I'll try that. I'll have to wait because someone else is creating the flash movies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top