开发者

actionscript 2.0 inputtext value

开发者 https://www.devze.com 2023-03-05 00:01 出处:网络
I have a little project to do in flash and I am new with action script. I am using actionscript 2.0 and I just want to make a alarm app which can ring a sound when the time comes :P.

I have a little project to do in flash and I am new with action script. I am using actionscript 2.0 and I just want to make a alarm app which can ring a sound when the time comes :P.

So I have 2 inputtext's one called alarm_hour and another alarm_min.

So the user enters the hour and the minute when it wants the alarm to ring. I am using Date class to pick the hour and the minute and my checkAlarm function it looks like this:

var my_date:Date = new Date();
var h:Number = my_date.getHours();
var m:Number = my_date.getMinutes();

var mi:String = alarma_minute;
var ora:String = alarma_hour;

if (((ora == h) && (mi == m))){

  开发者_开发技巧  _root.sunet.start(0, 99);
    _root.stare = 'start';
}

sunet its the sound file.. So the problem is that the if statement never activates but I don't know why because I have made a dinamic text and tested the values from ora and hour and mi and m and all are equals... what am I doing wrong?

Thank you!


I have managed to solve the problem by accessing the inputtext variables in this form: "variablename.text" and to do that I've had to change the inputtext instance name to "variablename" and now it works fine :D

0

精彩评论

暂无评论...
验证码 换一张
取 消