Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: RR and Flash - Evaluating Play Status

  1. #1
    Newbie
    Join Date
    Oct 2006
    Posts
    35

    RR and Flash - Evaluating Play Status

    I am working on a flash skin for RR and would like to know how to evaluate the play/mute/etc. status on the initial load.

    I am breaking out the skin into a main swf and then modules that will run inside the main swf. The main.swf will be the framework and hold all the audio controls so I believe it would only need to evaluate the status once, when the swf initially loads.

    I would like to evaluate whether or not the music is playing/muted etc. on startup so I can have the buttons adjust accordingly. aka. have the pause button showing if, on start up, the music is playing. Same with the mute button. If you muted before you left RR, I want RR to display the muted button when it starts back up.

    I have the play/pause button sitting on top of each other right now and have it set to hide/show right now and it works great, i just need it to evaluate if the music is playing so its set correctly each time. This is what I tried so far:

    if (_root.STATUS == "play") {
    playBtn._visible = false;
    } else {
    playBtn._visible = true;
    }

    Doesnt seem to have any effect. Button still shows in RR whether music starts or not.

    Also, does anyone have a basic audio player/audio browser fla file they would be willing to share so I can see how you are setting that up and how it works?

    Thanks in advance

    Justin

  2. #2
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    alright, so i kept searching, it sounds like i need to have indicators in my .skin file. I will take a look at this now.

  3. #3
    FreeDrive Creator CdRsKuLL's Avatar
    Join Date
    Feb 2004
    Location
    Manchester
    Posts
    3,471
    Hi m8, your right in that you will need the STATUS label in your .skin . You will also need to use CAPS.. ie PLAY not play

    CdR

  4. #4
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    Ya, i did notice that it wasnt capitalized and I did fix that.

    alright, so i took a look at the FSR's menu.skin and copied and pasted it all over awhile:

    /, L, x, y, w, h, color R;RGB, G, B, font size;FONT, font name, Code;LABELCODES, Tooltip;LABELALIGNMENT
    L,0,0,0,0,,,,,,"CUSTOMLABEL","Main"
    L,0,0,0,0,,,,,,"TRACKNAME",
    L,0,0,0,0,,,,,,"VOLUME",
    L,0,0,0,0,,,,,,"TODAY",
    L,0,0,0,0,,,,,,"TIME",
    L,0,0,0,0,,,,,,"STATUS",
    L,0,0,0,0,,,,,,"CURRENTTRACKTIME",
    L,0,0,0,0,,,,,,"TRACKTIME",
    L,0,0,0,0,,,,,,"TRACKNUMBER",
    L,0,0,0,0,,,,,,"GPSHDG",
    L,0,0,0,0,,,,,,"GPSSPD",
    L,0,0,0,0,,,,,,"GPSSAT",
    L,0,0,0,0,,,,,,"CPU",
    L,0,0,0,0,,,,,,"CUSTOMFREEFONE",
    L,0,0,0,0,,,,,,"ALBUMART",
    L,0,0,0,0,,,,,,"CUSTOMPL",
    L,0,0,0,0,,,,,,"PLAYLISTCOUNT",
    L,0,0,0,0,,,,,,"TAGARTIST",
    L,0,0,0,0,,,,,,"LISTPOS",
    L,0,0,0,0,,,,,,"KHZ",
    L,0,0,0,0,,,,,,"KBPS",
    L,0,0,0,0,,,,,,"PLAYLIST",

    /, I, x, y, w, h, Code;INDICATORCODES
    I,0,0,0,0,"MASTERMUTE"
    I,0,0,0,0,"SHUFFLE"
    I,0,0,0,0,"REPEAT"
    END

    and im using:

    if (_root.STATUS == "PLAY") {
    playBtn._visible = false;
    } else if (_root.STATUS != "PLAY") {
    playBtn._visible = true;
    }
    playBtn.onPress = function() {
    _root.playBtn.gotoAndStop("on");
    };

    i tested to make sure everything is right here. settings the visibility of the play button seems to work fine when its set to do it when the flash file loads (so my playBtn is on the root and everything is working correctly), it just doesn't seem be reading if the STATUS is PLAY or not. Am I missing something here?

    Why is it "_root.STATUS"? Can anyone explain how flash and RR interact with each other? I understand how the fscommand sends information and I get how the labels in flash work when the VAR are set to the correct name. What is it actually doing when its checking the PLAY status?

  5. #5
    FLAC Nomader's Avatar
    Join Date
    Apr 2006
    Location
    Greece
    Posts
    1,291
    it is _root.STATUS because:
    If a label is found on your .skin file, it is automatically sent to every single swf loaded in that .skin..and it will send it to the ROOT of ths swf..that's why

    so the SWF will be checking the variable "STATUS" for a certain value, when this value == PLAY, you can make your movie "gotoAndStop xxxxx" or whatever, when it has another value other than play (!=PLAY) do something else..
    fscommands is for the other way around, (the SWF sends commands to RR)..

    if you have that code run only ONCE then your button will not update whenever the value of STATUS changes...that is why you should have this in a sprite to run once a second continuesly in a loop.

  6. #6
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    thank you for the explanation Nomader, I think that I understand, but I think I am not being clear as to what i am trying to do.

    I think i am just missing a detail or two:

    *I have a main.swf, it has the play and pause movie clips on it.

    *The play clip is sitting above the pause clip.

    *Each clip has an off and on state.

    *When the "play" button is pressed, it highlights and then onRelease it hides itself and sends the "PLAY" command.

    *Now the "pause" button is visible.

    *When you press the "pause" button it highlights and onRelease, it hides and shows the "play" button and sends the "PLAY" command.

    *It works great right now, I just need the main.swf tocheck the status of the "PLAY" state and decide whether to show or hide the play button.

    *So if the music is playing when you shut RR (the "pause" button would be showing"), I want the pause button to be displayed when I open RR up.

    To do this, based on what you guys are saying, I would think this is what I would need this if statement at the top:


    if (_root.STATUS == "PLAY") {
    playBtn._visible = false;
    } else if (_root.STATUS != "PLAY") {
    playBtn._visible = true;
    }

  7. #7
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    I wonder if im checking the play status too soon or something...

  8. #8
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    ok, i think the problem is the actionscript is running before RR is even sending the PLAY status. I hooked the if statement up to a button and it works exactly as it should. Now i gotta figure out how to delay it from running

  9. #9
    Newbie
    Join Date
    Oct 2006
    Posts
    35
    function wait() {
    if (_root.STATUS == "PLAY") {
    playBtn._visible = false;
    } else if (_root.STATUS != "PLAY") {
    playBtn._visible = true;
    clearInterval(myTimer);
    }
    }
    myTimer = setInterval(wait, 0);

    Works fine now. I still think something was wrong to begin with. Why with the time set to 0, does this work? Did my if statement need to be inside some sort of function to work correctly?

  10. #10
    Constant Bitrate
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    169
    who cares, it works now, leave it the way it is :P

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 33
    Last Post: 03-28-2008, 02:18 PM
  2. 'Freedom' skin beta progress (Flash Based)
    By CdRsKuLL in forum RR Skins
    Replies: 1001
    Last Post: 01-18-2007, 11:39 PM
  3. RR Spiking CPU - Not Flash
    By tbird2340 in forum Road Runner
    Replies: 23
    Last Post: 03-30-2006, 02:40 PM
  4. Replies: 24
    Last Post: 03-03-2006, 12:36 PM
  5. Can this be done in RR and flash
    By tolisn in forum Road Runner
    Replies: 4
    Last Post: 06-16-2005, 01:57 PM

Bookmarks

Posting Permissions

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