dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: My standby screen wallpaper will not compile properly

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    4

    My standby screen wallpaper will not compile properly

    I'm trying to get this clock to work properly in my flash movie, but I'm getting loads of errors. The movie plays fine, but the clocks time is 00:00 and doesnt start counting. Its supposed to read the computers time. Is there anything wrong with my code? I have set the publish settings to flashlite 3.0

    Code:
    FLCmd("SetQuality", "high");
    mo = FLCmd("GetDateMonth");
    dd = FLCmd("GetDateDay");
    ww = FLCmd("GetDateWeekday");
    hh = FLCmd("GetTimeHours");
    mm = FLCmd("GetTimeMinutes");
    ss = FLCmd("GetTimeSeconds");
    if (mo <= 9)
    {
        mon1:num = 0;
        mon2:num = substring(1, 1)mo, ;
    }
    else
    {
        mon1:num = substring(1, 1)mo, ;
        mon2:num = substring(2, 1)mo, ;
    } // end else if
    if (dd <= 9)
    {
        day1:num = 0;
        day2:num = substring(1, 1)dd, ;
    }
    else
    {
        day1:num = substring(1, 1)dd, ;
        day2:num = substring(2, 1)dd, ;
    } // end else if
    weeks:num = substring(1, 1)ww, ;
    if (hh <= 9)
    {
        hour1:num = 0;
        hour2:num = substring(1, 1)hh, ;
    }
    else
    {
        hour1:num = substring(1, 1)hh, ;
        hour2:num = substring(2, 1)hh, ;
    } // end else if
    if (mm <= 9)
    {
        min1:num = 0;
        min2:num = substring(1, 1)mm, ;
    }
    else
    {
        min1:num = substring(1, 1)mm, ;
        min2:num = substring(2, 1)mm, ;
    } // end else if
    setProperty("short", _rotation, hh * 30 + mm * 0.5);
    setProperty("long", _rotation, mm * 6 + ss * 0.1);
    setProperty("second", _rotation, ss * 6);



  2. #2
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Clock

    Look At This
    Last edited by marlopax; 09-21-2009 at 06:08 AM.

  3. #3
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    mon2:num = substring(1, 1)mo,

    I don't think you want mo and a comma after the substring. You have syntax error this in many lines of code.

    Also you should consider working this for Flash Lite 1.1 which will give you many more devices for your audience. Your code seems fine for FL1.1 just change use the FSCommand2() syntax.


    Marlopax, please be sure to address a question in your response. It is fine to provide an example but is better to try and answer the question in the post because not everyone has time to download and look through FLA examples.
    aviarts.com - web development and flash development

  4. #4
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    You are correct hp3.

    Its is better to address the question, but when i saw the code, it struck me that how someone write such code without knowing the fault of such syntax in it?

    And obviously the FSCommand2 command part helps to ensure me that this code is just a decompiled one from somewhere, where the real coder will never do such mistakes.

    I also feel to help this forum and those members who just not want to learn the scripting but just wants to copy and paste the entire stuff from the original.

    You can see the line
    "but the clocks time is 00:00 and doesnt start counting."
    which Tolem mentioned. Whereas, in his code there is no such variable where the time can show in digit in such format. this reminds me to think that he is not familiar to flash, nor he knows about the scripts that supports in various version that adobe offers.

    My intention was to help the new flash coder, as well as to keep those type of people in the surface of learning, not taking them in depth of it.

    I think, without the example Tolem will not being able to see the script is running properly.
    By giving an example he might get interest to learn in depth.

    I am not hearting you Tolem. But the truth comes to me like this which you may also consider as true. May be I'm wrong. But we all here to learn more and to get help from others. So I did it without saying on my previous reply.

    But still I'll say that you are correct hp3.




    Regards


    MarlöPax

  5. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    4
    Thank you for the help! The example was very informative. I have experience in the animation side of flash (I have made several animated backgrounds for my mobile phones). This is just my first time trying to use action script to enhance my animations.

    I copied the code from a example on a forum for my cellphone, that is how I learn, by seeing how something is done first and then playing with it until I 'get' it. I have some coding experience in other languages but nothing in Action Script and especially not Flash Lite.

    The page I got it from used the "FLCmd" but I understand from what you guys are telling me I need to be using FSCommand2 and I have read up on that basic command (http://help.adobe.com/en_US/FlashLit...5f6e-7a56.html)

    Can you tell me what FLCmd is? I couldnt find any information on it and am confused as to why the two examples I found (although they were in Japanese) were telling me to use it.

    I was able to get the example clock working in my flash movie and will now try to modify the existing code I have with the new knowledge from the example clock to get it to work.

    There is no such variable for showing the time in digit format in my code, but I have made shapes for each number (digit) and am now trying to figure out how to get the shapes to tie into the code.

    It seems so complicated at first, for what is just a 10 frame animation that I made, to add a digital clock to it so that I can not only have a cool background on my phone, but know what the time is as well!

    While I am not trying to become a flash professional, I would like to learn enough scripting to be able to make these simple movies for personal use on my mobile phone. So I do appreciate the hand holding and help you have given me, thanks!
    Last edited by Tolem; 04-07-2009 at 06:55 PM.

  6. #6
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    FLCmnd may be something that was incorrectly translated.

    You can use FSCommand2 to get time, but you might find it easier to use the Date() object. Note that the Date() object is not backwards compatible with Flash Lite 1.1.

    Also if you are using the _rotation property with the hands of the clock then you will need to reset the property to 100% on each rotation because there was a bug in earlier releases of Flash Lite that reduced scaling of an object on each rotation.
    aviarts.com - web development and flash development

  7. #7
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    FLCmd is the wrong translation of command fscommand2 on decompiler. It could be say that it is a short form of fscommand2 which flash doesn't accept as fscommand2 function.

    I do appreciate you, and your learning technique. If you are still struggling with your shapes for each number (digit) comes in function on your phone, then here is a small gift from me.....

    Regards

    MarlöPax
    Last edited by marlopax; 09-21-2009 at 06:09 AM.

  8. #8
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    Hello Tolem

    How is your work going on?
    I'd like to see your work if you want to show some screen shots.

    Where are you from?

    regards


    marlopax

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center