FixYa.com
Technical Support, Instructions & Repair Service


Tags:

Macromedia Flash MX

Action script (by 5 users)

posted by cpalit on Aug 24, 2007


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.

This Problem has been added to the Share Your Expertise Page under "My Work Queue".

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


Best Solution
posted on Jun 02, 2008
Helpful (85)

Guest

Guest

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
poda patti

Was this solution helpful? Show your Appreciation by rating it:

Solution #2
posted on May 07, 2008
Helpful (85)

Guest

Guest

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
hi

thanks u giving the code for timer example

Was this solution helpful? Show your Appreciation by rating it:

Solution #3
posted on Jan 22, 2008
Helpful (85)

Guest

Guest

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
u cn also use
display=mydatee.getHours()+":"+mydate.getMiniut()+":"+mydate.getSecond();
:)

Was this solution helpful? Show your Appreciation by rating it:

Solution #4
posted on Jan 16, 2008
Helpful (85)

Guest

Guest

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
please give us good knolodge of action script

Was this solution helpful? Show your Appreciation by rating it:

Solution #5
posted on Dec 11, 2007
Helpful (85)

Guest

Guest

Rank:Apprentice Apprentice
Rating: 0%, 0 votes
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

Was this solution helpful? Show your Appreciation by rating it:

Solution #6
posted on Dec 19, 2007
Helpful (85)

kenu


Rank:Apprentice Apprentice
Rating: 80%, 10 votes
iukul

Was this solution helpful? Show your Appreciation by rating it:

Solution #7
posted on Aug 26, 2007
Helpful (85)

jbreth


Rank:Wiz Wiz
Rating: 82%, 140 votes
I tried your script and it all checked out fine when I ran it. Make sure you click on the first frame of layer action and open the Action Script Panel (F9). Once this is accomplished.

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:

Solution #8
posted on Oct 18, 2007
Helpful (85)

Brajesh


Rank:Guide Guide
Rating: 75%, 33 votes

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:

This Problem Also Relates To: Macromedia Authorware 7.0 for PC Macromedia Flash MX (FLM060D000) Macromedia Director Shockwave Studio 8 (WDW80D01) for PC Macromedia Dreamweaver 4.0 for Mac Macromedia Fireworks MX Macromedia Fireworks MX 2004 for Mac, PC Macromedia SoundEdit 16 2.0

Can you Help with these Graphics Publishing and Multimedia Software problems?

Macromedia Flash MX (FLM060D000)
micromedia projector
wlhen i try to open games... Answer This...
Macromedia Flash MX (FLM060D000)
macromedia projector error
When I load disc so I can down... Answer This...
Macromedia Flash MX (FLM060D000)
GETING THA US TIME
actually i have the code for... Answer This...
Macromedia Flash MX (FLM060D000)
screen saver
i need a screen saver, but... Answer This...
Macromedia Flash MX (FLM060D000)
How create a lence effect with...
I am work on a Flash Flip Book... Answer This...
Repair Service
Find Graphics Pub. Repairman Near You:

FixYa does not evaluate or guarantee the accuracy of any information provided through its proposed solutions, posts, or Expert Assistance Sessions. By entering this site you declare you read and agreed to its Terms. You may NOT copy or distribute the content that appears on this site without written permission from FixYa Inc.
© 2005-2008, FixYa, Inc. or its affiliates
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!