Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | RE: FLASH: get current time within flash? |
From: | Matt Wobensmith |
Date: | Thu, 20 Apr 2000 22:39:28 +0100 |
Marcus wrote:
>Sounds like the pressure is ON Matt.
Yeah, I guess it is!
OK people, this one should probably be a TechNote.
For now, the info is below. Forward at will. :>)
Additionally, I would appreciate all questions regarding this to go the list, and not to myself or MM Tech Support.
Matt
---------------
Matt Wobensmith
Macromedia Tech Support
Flash Team Lead
Here are the steps to pass the browser's date and time to Flash via JavaScript. You need to follow them all exactly or it won't work. If you are afraid to touch your HTML or JavaScript, then don't do it. :>)
1. Quit Flash. This is important.
2. Copy the text below, and paste it inside a BRAND NEW text file. It is a *customized* Flash HTML template that your Publish Settings will use for this exercise.
Mac - use SimpleText, PC - use Notepad. Or equivalent. Save the file and call it "Flashdate.html" and put it inside the Flash 4 > HTML folder.
$TTFlashDate
$DS
Pass the browser's Date string to Flash.
$DF
<HTML>
<HEAD>
<TITLE>$TI</TITLE>
<script language="JavaScript">
<!--
function flashDate() {
window.document.$TI.SetVariable("date", new Date());
}
//-->
</script>
</HEAD>
<BODY bgcolor="$BG" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" onLoad="flashDate()">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"
ID=$TI WIDTH=$WI HEIGHT=$HE>
$PO
<EMBED $PE WIDTH=$WI HEIGHT=$HE NAME=$TI
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect=true></EMBED>
</OBJECT>
</BODY>
</HTML>
3. Open a new file in Flash, and save it - call it "mmrules.fla".
4. Create an editable text field on the stage. Assign it variable name "date".
5. Add one more blank frame - not a keyframe - just a frame, to the timeline for a grand total of two frames.
6. From the File > Publish Settings, go to the HTML tab, and under the templates, choose "FlashDate".
7. Save it all and choose F12 - Preview in Browser. The data from the new Date() function should populate the text field on the stage.
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
Re: FLASH: get current time within flash, Bert
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]