Hi im looking for a simple code or flash file that includes either an or air now text wich changes with time or an image that changed with time.
please help me im sick of trawling the net![]()
Hi im looking for a simple code or flash file that includes either an or air now text wich changes with time or an image that changed with time.
please help me im sick of trawling the net![]()
Depends, do you want this automatically for a certain time each day, each week, every 6 hours, etc or do you want it done manually? (will change when user logs in?)
If the first option you will need to get the local time:
This will return the local time. Then you need to call it...Code:function getTime () { var time = new Date(); var hour = time.getHours(); var minute = time.getMinutes(); var second = time.getSeconds(); var temp = ""+((hour>12) ? hour-12 : hour); temp += ((minute<10) ? ":0" : ":")+minute; temp += ((second<10) ? ":0" : ":")+second; temp += (hour>=12) ? " P.M." : " A.M."; return temp; }
This code placed on the first frame of a dynamic text movieClip and will get the current local time.Code:onClipEvent (enterFrame) { time = getTime(); }
Then use your Dynamic Text box for the On/Off air coded based on time.
this place on the first frame of the movie will display the time and either on or off the air.Code:onClipEvent (enterFrame) { time = getTime(); if (hour==6) { time = getTime()+"On The Air"; } else { time = getTime()+"Off The Air"; } }
You can adjust the if/else to suit the hour(s) On the air should be displayed, etc.
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
ok i need it to change between every hour of the day 7 days a week thats it.
i have seen other code but a bit unsure,
either images or text.
cheers
i know its not that simple but i need something like,
if day = (1)/monday and if time = 12am get img src "http://image.gif"
if day = (1)/monday and if time = 01am get img src "http://image2.gif"
and so on untill every day and hour is covered
i wish it was that simple but very difficult unless you know what you are doing. i bought a book on java and it is just plain java jaba jaba. lol
help before i go mentle lol
regards lee
Well, this is the Flash forum, not the Java forum, so which do you need? They are not the same thing...
Basically you want 168 different images to show? (24 hours a day, 7 days - 24*7=168)
If they are names image.jpg, image1.jpg, image2.jpg it will make it easier.
I want to make sure you want to use Flash before I get into it though...
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
This doesnt sound like flash is necessary? you could very easily use Javascript which would provide alot better access.
also if there is a new person on every hour every day... if not you should edit the script, because theres no sense in reloading the element if the same image will be displayed
Very rarely is Flash "necessary" but it sure is fun![]()
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
hi there
i really dont mind flash would be good and java would be could i would happilly have flash i just need the coding
cheers
Probably the easy way would be this:
make a new symbol, a movie clip name it clock. In the MC make a dynamic text box with the var: time. In the first frame of clock MC put this code:
Now, drag an instance of clock MC to the stage. In the first frame of the stage place this action script:Code:function getTime () { var time = new Date(); var hour = time.getHours(); var minute = time.getMinutes(); var second = time.getSeconds(); var temp = ""+((hour>12) ? hour-12 : hour); temp += ((minute<10) ? ":0" : ":")+minute; temp += ((second<10) ? ":0" : ":")+second; temp += (hour>=12) ? " P.M." : " A.M."; return temp; }
This will make a real time clock in the clock MC. It will also load the jpg into a blank MC named "holder", which we need to create:Code:onClipEvent (enterFrame) { time = getTime(); if (hour==12) { loadMovie("image1.jpg", _root.holder); } else if (hour==11){ loadMovie("image2.jpg", _root.holder); } //continue else if's for the rest of the hours. }
click insert>>new symbol name it holder. You will currently be in edit mode of holder MC. click "scene 1" to exit out of edit mode.
Drag an instance of holder from the library to the stage where you want the image to appear. Give holder MC an instance name of holder. in the library right click the holder MC and click "linkage" then check the box next to "export for actionscript" leave everything else as it appears and click okay.
test movie. (note the images must be in the same directory as the swf for them to load).
Enjoy![]()
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
is there anyway you can make me a demo?
and send it to my email.
info@lee-mills.co.uk
if possible dont worry if you cant i will have to practise.
regards lee
Bookmarks