When user enters and exits one movieclip, button changes color

Hello,
I currently have a slideshow-style navigation site.  There are five buttons on the bottom and when the user clicks each button, it triggers a nested movieclip to play.  I would like the button to be highlighted when the corresponding movieclip is playing, but when they click another button and another movieclip plays, I want the button to go back to its original color.
The problem is that the movieclips that are playing are nested two levels down and the buttons have to be on the main timeline.  I think I might need an event listener to see if a certain nested movieclip is playing, to know to change the button color.  It seems to easy but I can't figure it out, thanks for any help!

Hi again!  Sorry, I keep changing my mind on whether I've figured this out or not.  Now I need the buttons to become disabled when they are highlighted and active.  I tried putting a:  btns[i].enabled = false;  in the else part of the for-else statement and it didn't work.  Where would I put that kind of code?  Thanks!
stop();
//attach sounds
Sound1 = new Sound();
Sound1.attachSound("Sound1");
Sound2 = new Sound();
Sound2.attachSound("Sound2");
Sound3 = new Sound();
Sound3.attachSound("Sound3");
//buttons
//nav buttons
b1.onRelease = function() {
    gotoAndStop(1);
    stopAllSounds()
    activeBtn(b1);
b2.onRelease = function() {
    gotoAndStop(2);
    stopAllSounds();
    activeBtn(b2);
b3.onRelease = function() {
    gotoAndStop(3);
    stopAllSounds();
    activeBtn(b3);
//array for highlighted button state
var btns:Array = [b1, b2, b3];
function activeBtn(mc:MovieClip):Void{
   for(var i:Number=0; i<btns.length; i++){
      if(btns[i]!=mc){
         btns[i].gotoAndStop("inactive");
      }else{
         btns[i].gotoAndStop("active");

Similar Messages

  • Add days to the dates when user enter +

    hello ,
    i have requirement that when user enter + 30 in date field he got + 30 dayas of current date is thr any why to do this it is modulpool and i have taken date field on screen.

    here is sample code to show next and previous month on button click and show current month
    and year default.
    REPORT  ztn_datechk_button.
    TABLES sscrfields.
    TYPE-POOLS icon.
    DATA month TYPE i.
    PARAMETERS: date TYPE spmon .
    INITIALIZATION.
      date = sy-datum+0(6) .
      "date = sy-datum+0(2) - 1.
      IF date+4(2) < 1 ."or date+4(2) > 12.
        date+4(2) = 12.
        date+0(4) = date+0(4) - 1.
      ELSEIF date+4(2) > 12 ."or date+4(2) > 12.
        date+4(2) = 1.
        date+0(4) = date+0(4) + 1.
      ENDIF.
      SELECTION-SCREEN  PUSHBUTTON 50(15)  but1 USER-COMMAND prev VISIBLE LENGTH 3.
      SELECTION-SCREEN   PUSHBUTTON 53(15) but2 USER-COMMAND next VISIBLE LENGTH 3.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name   = icon_previous_value
          info   = 'PREVIOUS'      "text = 'Button 2'
        IMPORTING
          RESULT = but1
        EXCEPTIONS
          OTHERS = 0.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name       = icon_next_value
          info       = ''      "text = 'Button 2'
          add_stdinf = ''
        IMPORTING
          RESULT     = but2
        EXCEPTIONS
          OTHERS     = 0.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'PREV'.
          date = date+0(6) - 1.
          IF date+4(2) < 1 ."or date+4(2) > 12.
            date+4(2) = 12.
            date+0(4) = date+0(4) - 1.
          ENDIF.
        WHEN 'NEXT'.
          date = date+0(6) + 1.
          IF date+4(2) > 12 ."or date+4(2) > 12.
            date+4(2) = 1.
            date+0(4) = date+0(4) + 1.
          ENDIF.
      ENDCASE.
      IF date+4(2) < 1 OR date+4(2) > 12.
        MESSAGE 'Invalid Month' TYPE 'E'.
      ENDIF.

  • How to populate date & time when user enter data for custom table in sm30

    Can anyone tell me How to populate system date & time when user enter data for custom table in sm30..
      Req is
      i have custom table and using sm30 user can enter data.
    after saving date i want to update date & time in table
    Pls let me know where to write the code?
    Thanks in Advance

    You have to write the code in EVENT 01 in SE54 transaction. Go to SE54, enter your Ztable name and in the menu 'Environment-->Events'. Press 'ENTER' to go past the popup message. In the next screen, click on 'New Entries'. In the first column, enter 01 and in the next column give some name for your routine(say UPDATE_USER_DATE_TIME). Then click on the souce code icon that appears in blue at the end of the row. In the code, you need logic like below.
    FORM update_user_date_time.
      DATA: f_index LIKE sy-tabix.
      DATA: BEGIN OF l_total.
              INCLUDE STRUCTURE zztable.
      INCLUDE  STRUCTURE vimtbflags.
      DATA  END OF l_total.
      DATA: s_record TYPE zztable.
      LOOP AT total INTO l_total.
        IF l_total-vim_action = aendern OR
           l_total-vim_action = neuer_eintrag.
          MOVE-CORRESPONDING l_total TO s_record.
          s_record-zz_user = sy-uname.
          s_record-zz_date = sy-datum.
          s_record-zz_time = sy-uzeit.
          READ TABLE extract WITH KEY l_total.
          IF sy-subrc EQ 0.
            f_index = sy-tabix.
          ELSE.
            CLEAR f_index.
          ENDIF.
          MOVE-CORRESPONDING s_record TO l_total.
          MODIFY total FROM l_total.
          CHECK f_index GT 0.
          MODIFY extract INDEX f_index FROM l_total.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " UPDATE_USER_DATE_TIME
    Here ZZTABLE is the Z table and ZZ_USER, ZZ_DATE, and ZZ_TIME are the fields that are updated.

  • How to catch filenotfoundexception when user enters a bogus page

    How to catch when user enters a bogus jsp page. I have login.jsp. If someon enter log.jsp i get javax.servlet.ServletException: java.io.FileNotFoundException and then the whole path is shown. This onlyhappens with 9ias. When i was using http server that came with 9i database, i was able to catch this with send_error=true in zone.properties. It doesnt work with 9ias. How is everyone catching these errors? I cant seem to find out how to do it.
    Thanks

    Hi Adam,
    I am also facing the same problem of the java.io.FIleNotFOundException in the browser display when i am giving a wrong file path in the Url. you have mentioned that you have solved it when you were using Orcale 8i Http Server, can you please guide me for that( as we are also using Oracle 8i) I checked with putting send_error=true in zone.properties file but that is not working. What exctly you have done to get rid of that error message. I am using Windows Nt platform.
    Thanks and Regards.
    Arnab

  • Problems when user enter the field

    I have problem when user enter the field, but it cannot retrieve from the table. Below is my program, help me to check is it correct or not, THANKS
    <input type="text" name="po_num<%=i%>" style="width:100%;text-align:left;" onChnage="chkPOexist(<%=i%>)">
    Function chkPOexist(i){
    if documen.all.po_num.value == null {
    alert ("PO cannot be null");
    else {
    po_num = new String;
    po_num = eval(document.po_num[i].value)
    alert(po_num);
    <% System.out.println("PP " +po_num);
    sql_query = "SELECT po_num"+
    " FROM pomast"+
    " WHERE po_num '"+po_num+"' ";
                        try{
                        rset = db.execSQL(sql_query);
                        catch(SQLException e) {
                        System.err.println("Error in query");
                        while(rset.next()== true){
    po_num = rset.getString("po_num");
    %>
    </select value="<%=po_num%>"><%=po_num%></select>
                        <%}%>

    You seem to have some confusion between java and javascript, and when they run.
    Java code runs only on the server, and produces an HTML page.
    Javascript code runs on the client.
    The two can not communicate. Specific to your example you seem to think that the java code will be executed by your onChange event.
    This is not the case.
    In order to run java code again you have make a request by submitting the form, or clicking on a link.
    Cheers,
    evnafets

  • How to get login page when user clicks on browser's back button

    Hi,
    I am using struts framework.
    I have set property nochache=true in response header of all pages.
    So, browser does not caches my pages.
    Now,when I am clicking on browser's back button, I am getting following message..generated by browser.
    Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
    To resubmit your information and view this Web page, click the Refresh button.
    Instead of that I want to show user a login page, when it clicks on back button.
    Can anyone help me?

    Hi,
    I agree with your suggestion.But my query is,
    If you have seen many credit card or banking websites,generally when user clicks on browser's back button,its redirectly user to login page of it for security reasons.
    I want to implement that kind of functionality.So need help on that point

  • Profiler API - Locks, Threading.Monitor.Enter and Exit

    I'm using the Profiler API in a project in order to track the locks made using Monitor.Enter, Monitor.Exit, and the lock keyword. I planned to do this by outputting using a pipe, the events from the FunctionEnter3WithInfo and FunctionLeave3WithInfo callbacks.
    These callbacks are called when methods are entered and exited, and appear to be functioning fine regarding their implementation - they generate a large output of methods that had been entered and left, but I'm not receiving callbacks for the following:
    ENTER: Monitor.Exit
    LEAVE: Monitor.Enter and Monitor.Exit
    Oddly enough, I do get receive a callback for entering Monitor.Enter. Other than these problematic methods, I appear to be getting calls from the Profiler API for everything else. 
    Is there a known issue regarding these methods not being reported by the API? 
    Alternatively, if there's a better way of achieving my goal than the way I'm doing it, feel free to point me in the right direction :)
    Thanks,
    Olu

    Thanks for the reply Brian,
    I don't get a JITInlining callback for Monitor.Exit (however I do for some Monitor.Enter calls). For FunctionTailcall3WithInfo, I also don't get a callback for Monitor.Exit (but I do for some Monitor.Enter calls).
    I'm not getting anything from ExceptionUnwindFunctionEnter, though when manually tested by throwing an exception within a try-catch, I get a callback.
    If it helps, I have the following flags set for events:
    COR_PRF_MONITOR_ALL
    COR_PRF_ENABLE_FUNCTION_ARGS
    COR_PRF_ENABLE_FUNCTION_RETVAL
    COR_PRF_ENABLE_FRAME_INFO
    Additionally, I've tried the following flags to see if it resolves the issue:
    COR_PRF_DISABLE_INLINING
    COR_PRF_DISABLE_OPTIMIZATIONS
    Edit 1: Using COR_PRF_DISABLE_OPTIMIZATIONS now means I get a callback to FunctionLeave3WithInfo when Monitor.Enter leaves, however there is still no sign of Monitor.Exit
    Edit 2: As a test, in the small application that I'm profiling, I've wrapped the Monitor.Exit and Monitor.Enter method calls in another class, so I can call them as so:
    CCMonitor.Enter(obj) and CCMonitor.Exit(obj).
    The profiler reports both the enter and leave of these functions correctly.
    Thanks,
    Olu

  • I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.Not working in USA timezone.

    I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works fine in our side (Timezone,kolkata ,india even for Timezone,slvaniya,USA) but our USA client is telling that on changing the date it not starts from start-up sequence.Can anyone plz suggest the reason for it.

    This is the code which we have used.
    //////////Return if it is first time for the day or not//////////////
    + (BOOL)isFirstTimeToday {
    BOOL result = YES;
    NSDate *now = [[NSDate alloc] init];     /// represents the current time
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: now];
    NSDate *today = [gregorian dateFromComponents:components];
    [now release];
    [gregorian release];
    NSDate *savedDate = [[NSUserDefaults standardUserDefaults] objectForKey:LAST_TIME_VISITED];
    if (savedDate) {
    if ([today earlierDate:savedDate] == today) {
    result = NO;
    return result;
    ////////Stores the date/////////////
    + (void)userDidVisitReenforceScreenToday {
    [[NSUserDefaults standardUserDefaults] setObject:[NSDate todayAtMidnight] forKey:LAST_TIME_VISITED];
    ////////////What [NSDate todayAtMidnight] stores/////////////////////
    + (NSDate *)daysFromNowAtMidnight:(NSInteger)nOfDays {
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow: (86400*nOfDays)];
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: date];
    NSDate *dateAtMidnight = [gregorian dateFromComponents:components];
    [gregorian release];
    NSLog(@"dateAtMidnight : %@",dateAtMidnight);
    return dateAtMidnight;
    + (NSDate *)todayAtMidnight {
    return [self daysFromNowAtMidnight:0];
    Please Suggest..

  • I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works with iPod not with iPhone

    I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works with iPod not with iPhone

    Try posting in the developer forums to see if you can get some assistance,you'll have to be a registered developer for access though.
    developer.apple.com

  • My user name and pass word have not changed  I can't get into my gmail

    My user name and pass word have not changed  I can't get into my gmail

    Can you access the email on a computer using a web browser meaning are you sure it is not a problem on the gmail end?

  • Can Video widgets start and stop when entering and exiting the browser viewport?

    I like to use multiple autoplaying/looping video clips on a single page but I need to figure out how to make the videos start only when they enter the viewport on a browser and stop after they exit the viewport. Does anyone know a way to do this?

    I do not know if this can have an affect on it but the videos are being downloaded through multiple computers to a private server and being accessed through the mac. Please let me know what you think.

  • Using addEventListener for Enter and Exit frame

    hi , sometimes i want to set some function in specific frame in start and exit this frame
    for example i have Flv player in frame 20 , i have background sound ( mp3 player ) so i want when swf goes to this frame my sound goes Off and when Exit from it and go to another frames the sound played again ...
    i put these script in frame 20 :
    addEventListener(Event.ENTER_FRAME,enterfunc);
    function enterfunc(e:Event):void {
        trace("I started");
    addEventListener(Event.EXIT_FRAME,exitfunc);
    function exitfunc(e:Event):void {
        trace("will Exit");
    but after test movie i see I started and will Exit runs Repeatly without stoping !!
    Notice : first i put my sndChannel = soundClip.play; and sndChannel = soundClip.stop;  but my music runs over and over and finally my system Hanged and need to Restart so i use trace to see
    so whats a problem ?  thanks for spending time and help me

    kglad wrote:
    // in frame 1:
    function f():void{
    trace("function f is executing when the playhead is in frame:", this.currentFrame);
    // in frame 2:
    f();
    This works well For Excute Function on entering Frame Once !! thanks ...
    but Only 1 More Question :
    as You told me in your No.2 Replay :
    I try to add some movieclip with instance name Or FLv playback with instance name and then Try to use this codes :
    mymc.addEventListener(Event.ADDED_TO_STAGE, addedF);
    function addedF(e:Event):void{
    trace("I Start");
    mymc.addEventListener(Event.REMOVED_FROM_STAGE, removedF);
    function removedF(e:Event):void{
    trace("I exit");
    why The removedF function Works well and the addedF function not work ?!?   in fact nothing Happend on Enter This Frame but on exit i see my I exit Trace !!

  • How to catch java.io.FileNotFoundException when user enters a.jsp which is not a vali

    How to catch java.io.FileNotFoundException when a user enters a bogus jsp page. For example. I have a page called login.jsp. If a user enters log.jsp, the entire path is show and i get java.io.FileNotFoundException. This should not happen. This only happened since I upgraded to 9iAS. I tried send_error=true in zone.properties like i did when i was just using oracle http that came with database and it doesnt work. How are all you guys catching this?? I cant find any documentation. They say send_error=true will work, but IT DOESNT.
    Thanks for your time

    Hi Adam,
    I am also facing the same problem of the java.io.FIleNotFOundException in the browser display when i am giving a wrong file path in the Url. you have mentioned that you have solved it when you were using Orcale 8i Http Server, can you please guide me for that( as we are also using Oracle 8i) I checked with putting send_error=true in zone.properties file but that is not working. What exctly you have done to get rid of that error message. I am using Windows Nt platform.
    Thanks and Regards.
    Arnab

  • Why does imail on my iMac keep asking for passwords, that when I enter the correct one it does not recognise, but Yahoo does, its driving me nuts!!!!

    What is going on at Apple, mail keeps asking for a password, that when I enter, it ignores, my imac is telling me it cannot talk to the Yahoo server, but I can get through every time on Safari. This is driving me nuts!!!

    you are lucky i will say,
    i got problems with email, update,id,keyboard mistyping, wifi, they said they will send me one they never did, and don't reply anymore, after 55 days witha  3 years warranty. good luck. i swear it is true.

  • Loading a video/image on entering and exiting a marker

    Hi,
    i am doing a project with Adobe director. I was wondering if
    there is any piece of code I can use if I want to run a flash file,
    for example, when I go to a marker. So that I run a flash flash
    before the marker loads and similarly run another flash file when I
    click on some other marker and exit that specific marker.
    I want to run the flash file before the contents of the
    marker is displayed and similarly for exiting????
    ASAP....thanks in advance

    For the start of the new section, you could put the Flash
    sprite at the marker,
    have it play and then, when it finishes, move to another
    frame and show the new
    content. If the Flash sprite is integral to the content, then
    just have it play
    at the frame where the marker is located.
    When you want to leave a particular area, have the
    navigation button store the
    new marker's name in a variable and then play the closing
    Flash sprite. When
    the Flash finishes have it tell the play head to move to the
    marker that is
    stored in the variable.

Maybe you are looking for

  • How to sync an iPhone 4 with a New Computer?

    I have a broken Windows Vista laptop, an iPhone 4 with broken WIFI, and a new Windows 7 PC. I'd like to backup the data on my iPhone somewhere, but the wireless iCloud backups won't work because my phone has no WIFI, and the old laptop I used to use

  • I've lost the ability to loop audio and midi regions...

    so it seems as though everyone wishes they could turn the loop function off so as to increase productivity and editing speed. well, somehow i've managed to turn it off and i don't know how. I actually don't want it turned off, but somehow when i plac

  • Two Qs: Help to partition 800 FireWire, &Any FireWire 800 Router/Hub users?

    Needed more hard drive, so I added a 2TB-FireWire 800 drive to system. First thing on it is time machine backup. Would like to reconfigure it for the backup along with freeing up space on the main internal drive by moving files/applications, etc onto

  • Warehouse management trasactional flow

    Hi Experts, can any one tell me the trasactional flow of warehouse management with SD-functionality.where exactly it works pls do needful.urgent. my mail id is [email protected] ex like : va01-vl01n-vf01 regards veera.

  • UIWebView remove white background

    Hi everyone: I'm trying to use the UIWebView-derived class to display contents in my view. It works great, except that this UIWebView is displayed on the black background and right when the view loads up the UIWebView flashes the white background for