×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    3

    How can I include battery and signal in Flash HS?

    I am trying to import Battery and Signal levels using these tutorials:
    http://www.developer.nokia.com/Commu...gnal_indicator
    http://www.developer.nokia.com/Commu...tery_indicator

    but the problem is that it's.. just.. not working for me!
    so can someone give me a video tutorial?
    and in the mentioned tutorial, by "layer" do they mean objects?
    I am not using adobe flash cs, i am using swishmax. Please tell me exactly what object to put where and what to name that object.

    I tried this too:
    onFrame (1) {
    levelsNumber=8;
    batMax = fscommand2("GetMaxBatteryLevel");

    batText.text= fscommand2("GetMaxBatteryLevel");
    }

    where batText is a dynamic text object.

    I also tried batText.text=batMax but still getting either Undefined or blank

    So, does it mean that mobile is not reading it?
    I am testing it just by playing it simply as swf file.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: How can I include battery and signal in Flash HS?

    Usman,

    SwishMax doesn't support Flash Lite fscommand2. So it is most likely that the bytecode for this function is not added. To make sure fscommand2 works via SwishMax, try some other fscommand2 and see if it's only problem with battry levels or other are not working as well.

    You can alternatively compile separate SWF using Flash CS3+ which contains these fscommand2, and just load this SWF from your SwishMax app and call the frames to get the battery level.

    Best,

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    3

    Re: How can I include battery and signal in Flash HS?

    Sorry for very late response, but I made it work using swishmax after some days of posting it. I used this script for signal:

    onFrame (1) {
    current = fscommand2("GetSignalLevel");
    max = fscommand2("GetMaxSignalLevel");
    currentRatio = current/max;
    currentFrame = int(currentRatio*7);


    batSource = fscommand2("GetNetworkStatus");
    if (batSource == 0) { //If there is no network
    signal_mc.gotoAndPlay(7);
    }
    else {
    signal_mc.gotoAndPlay(currentFrame);
    }


    }
    onFrame (2) {
    call(1);
    }


    -----------------
    And this for battery:

    onFrame (1) {
    current = fscommand2("GetBatteryLevel");
    max = fscommand2("GetMaxBatteryLevel");
    currentRatio = current/max;
    currentFrame = int(currentRatio*battery_mc._totalframes);


    batSource = fscommand2("GetPowerSource");
    if (batSource == 0) { //If charger is not plugged
    battery_mc.gotoAndPlay(currentFrame);
    }
    else {
    battery_mc.play();
    }


    }
    onFrame (2) {
    call(1);
    }

    ------------
    where signal and battery are separate movie clips and have signal_mc and battery_mc named clips in them respectively, the inside clips have images of signal levels with appear/disappear scripts on each frame according to the needs

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: How can I include battery and signal in Flash HS?

    Glad to know you managed to make it work.

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

Similar Threads

  1. how to add both signal and battery indicator in a swf?
    By omerjawhar in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2012-03-26, 10:41
  2. How to restore battery and network signal?
    By saniat.rasel in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-04-06, 11:08
  3. N70 signal&battery strength disappear
    By sevenhills in forum Symbian
    Replies: 9
    Last Post: 2008-04-09, 11:10
  4. Battery and Signal level
    By nike28 in forum Symbian
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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