Princess JoJo
Princess JoJo

Reputation: 1

Actionscript 3 does not work .. it didn't give errors

I am creating a clock using this code:

var date:Date = new Date();
var time:Timer = new Timer(1000); 
time.addEventListener(TimerEvent.TIMER, actualiser);
time.start();

function actualiser(e:TimerEvent){
    date = new Date();
    var s:uint = date.seconds;
    var m:uint = date.minutes;
    var h:uint = date.hours;
    sec_mc.rotation =(s * 6);
    min_mc.rotation =(m * 6);
    heur_mc.rotation =(h * 30) +m/2;
}

But, it seems that the code is not executing, I can’t even trace anything written in constructor of my document class. When I run it nothing happens and when I try to debug I get the alert message saying:

You cannot debug this SWF because it does not contain ActionScript

What can be wrong?

Upvotes: 0

Views: 1988

Answers (2)

user1271208
user1271208

Reputation:

Try to check the code in a new fla. Write the following in your 1st frame action panel. This does give proper output and you can see the traces in the output panel. There is no issue with the code logic. Might be some issue with the movieclip being used.

var date:Date = new Date();
var time:Timer = new Timer(1000); 
time.addEventListener(TimerEvent.TIMER, actualiser);
time.start();

    function actualiser(e:TimerEvent){
        date = new Date();
        var s:uint = date.seconds;
        var m:uint = date.minutes;
        var h:uint = date.hours;
        trace(h+":"+m+":"+s);
    }

In case of CS5 , try the following steps :

WINDOWS:

1. Quit Flash 2. In a text editor, open the jvm.ini file from the following location:

2.1. Windows XP: System Hard Disk\Documents and Settings\user\Local Settings\Application Data\Adobe\Flash CS5\language\Configuration\ActionScript 3.0\jvm.ini
2.2. *Windows Vista or Windows7:* System Hard Disk\Users\user\AppData\Local\Adobe\Flash CS5\language\Configuration\ActionScript 3.0\jvm.ini

(You might need to turn on “show hidden files”)
3. Change -Xmx128m to -Xmx256m and save the file.

Upvotes: 2

MKII
MKII

Reputation: 911

EDIT: Uhm. Is that all you have? Because you need to import the needed packages, etc. Also, are you sure you linked everything up?

Upvotes: 1

Related Questions