while trying to create an animated digital clock from tutorial,I put the following script:
time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12;
}
if(hours<10)
{
hours = "0" + hours;
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
Clock_text.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;
Step 10
Click on the second frame of layer action and press F6 key. Then, enter this code inside the actions panel:
gotoAndPlay(1);
Test your Movie (Ctrl+Enter).
but it is not showing result.
I could not find the error.please help.
4 Other Users Have The Same Problem
Comment by Guest, posted on Aug 28, 2008
i need to access another websites when u clic flash movie and i have used this command---- on (release) {
getURL ("http://www.flashvault.net","_blank");
} and it says there 's error saying **Error** Scene=Scene 1, layer=Layer 3, frame=60:Line 1: Mouse events are permitted only for button instances
on (release) {
Total ActionScript Errors: 1 Reported Errors: 1
Comment by balamirra5, posted on Aug 23, 2008
yes i too have the same problem.
Comment by Guest, posted on May 08, 2008
how can use the flash script
Comment by rpanda2007, posted on Nov 30, 2007
i have puted the script but i found one error . this is the error
i will tell u how i did it i had puted the script on frame 1 and click on the second frame and pressed f 6
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 28: Syntax error.
Step 10
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 30: Syntax error.
Click on the second frame of layer action and press F6 key. Then, enter this code inside the actions panel:
Total ActionScript Errors: 2 Reported Errors: 2
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
thanks u giving the code for timer example
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12;
}
if(hours<10)
{
hours = "0" + hours;
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
Clock_text.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;
Step 10
Was this solution helpful? Show your Appreciation by rating it:
Was this solution helpful? Show your Appreciation by rating it:
Click on the second frame of layer action and press F6 key.
Like I said everything worked out when I tried using the script you posted so, if anything I would suggest starting from scratch.
Was this solution helpful? Show your Appreciation by rating it:
steps to solve this problem
1. open flash
2. select rectagle
3. draw shape in scene.
4. convert it to movieclip first
5. double click to edit movieclip
6. put dynimic textbox over rectangle and name it [Clock_text]
7. the paste the code in time line above the object layer given below.
// ActionScript Started
function brajesh(){
time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12;
}
if(hours<10)
{
hours = "0" + hours;
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
Clock_text.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;
}
brajesh();
setInterval(brajesh,1000);
//ActionScript Ended
8. come out to the scene by clicking the link given above the time line.
9. then select the keyframe where movieclip is placed.
10. press F5 to increase blank keyframe
11. Right click the mouse over the keyframe then select [create motion tween]
12. Press F6 at the end of the frame to add key frame then move the movie clip to your desired place
13. Press (Ctrl+Enter).to test your movie
it will show result.
Was this solution helpful? Show your Appreciation by rating it:
Post a New problem for Macromedia Flash MX
Email this problem
Can you Help with these Graphics Publishing and Multimedia Software problems?
macromedia projector error
How create a lence effect with...
