PDA

View Full Version : Date in a Flash Movie


davidtrin
05-29-2001, 10:08 PM
Hi there, I've got a problem that is nearly solved but I can't figure now what i did wrong.
I want do put the date in my Flash movies like in a html page.
I've got flash 4 and this example,


<script language="JavaScript">
var mName = "moviename";
function mObject(mName){
if (navigator.appName.indexOf ("Microsoft") !=-1){
return window[mName];
}
else{
return document[mName];
}
}
function getCurDate () {
curDate = new Date();
curMonth = curDate.getMonth() + 1;
monthDay= curDate.getDate();
curYear= curDate.getYear();
if (navigator.appName.indexOf ("Microsoft") = -1){
curYear = 1900 + myyear;
}
movieobject(moviename).SetVariable("date", curMonth + "/" + monthDay + "/" + curYear);
}
</script>

changes in your .swf callin script:

in <object tag line add: ID="moviename"
in <embed tag line add: name="moviename" swliveconnect=true

just call it from flash like: GetURL("JavaScript:getCurDate();")


This one seem to be the one but I want to use a specific font and can't
see how to put this GetURL action in my textfield.
Please someone help me with this!
Thanks in advance.
David

Jesse
05-30-2001, 08:25 AM
You can't calla ctions from a text field in F4, you 'll have to use a button or a frame action.

Cheers

Jesse

davidtrin
06-01-2001, 12:09 AM
Hi Jesse, I knew that it wasn't possible to call the action from a text field. But this is my main problem.
How to call the date?
I thought about Setting a variable, but how?
If you can find me a way of putting the date with the choice of choosing the font you wish, or even not, please let me know.
I'm trying to solve this for so long that I just wanted an answer.
cheers
David

Jesse
06-01-2001, 09:06 AM
I missunderstood. Sorry I fiddled but I'm not good with JavaScript and I couldn't get it working. I hope someone else can help.