and timer continue..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • zaknbou
    Forum Member
    • Nov 2005
    • 63

    and timer continue..

    Timer start at 1000 and a picture is loaded then at 5000 a video
    is loaded ? how could i do that ??
  • stickck
    Indigo Rose Customer
    • Feb 2004
    • 617

    #2
    not sure i fully understand but here you go. I'm guessing that you want a picture to load after 10 seconds (i havent used AMS in a while so i think 1000 = 10 seconds) then on the On-Timer event for the page, you would do a count function like this
    Code:
    count = count + 1;
    if count == 10 then 
    -- LOAD YOUR IMAGE HERE
    end
    
    if count == 50 then
    -- LOAD YOUR VIDEO HERE
    end
    could also use an ELSE IF statement but i like to keep mine seperate. (personal preference)

    you would set your timer to
    Code:
    Page.StartTimer(100);
    also you need this on PAGE SHOW or GLOBAL
    Code:
    count = 0;
    that should get you going in the right direction

    chris

    Comment

    • yosik
      Indigo Rose Customer
      • Jun 2002
      • 1858

      #3
      Small change.
      1000ms = 1 second, so you have to correct the numbers accordingly
      Yossi

      Comment

      • stickck
        Indigo Rose Customer
        • Feb 2004
        • 617

        #4
        thanks yosik! it's been a while since i've used AMS so i'm just a little rusty.!

        chris

        Comment

        • Intrigued
          Indigo Rose Customer
          • Dec 2003
          • 6138

          #5
          stickck, I was wondering if you had been in your Bat Cave.

          Glad to see you back on the radar.

          Intrigued

          Comment

          • stickck
            Indigo Rose Customer
            • Feb 2004
            • 617

            #6
            been really buisy at work! now i cant wait to move come november 2007. it just cant get here quick enough. i also picked up a few more toys. i bought a drawling pad 10 x 13. very cool!!!! its taking a little while to get used to it. i also bought a Pachinco machine. i'm building a cabinet for it now. i'm putting spiderman images all over the cabinet.

            Fun stuff. i'm also working on converting that test taker program over to flash.
            i havent been able to get back to it since i posted the sample on here a few weeks ago.

            i'll try and post some more updates as i get it done.

            Talk to you later

            chris
            Attached Files

            Comment

            • Intrigued
              Indigo Rose Customer
              • Dec 2003
              • 6138

              #7
              Ah, you're finally moving to the Antarctic? *Gulp*

              (pokes stickck's ribs with index finger)

              Intrigued

              Comment

              • stickck
                Indigo Rose Customer
                • Feb 2004
                • 617

                #8
                its either there or Virginia Beach area. i'm hoping Alaska though. More Pay, Less Headache.

                chris

                Comment

                • willfreer
                  Forum Member
                  • Aug 2004
                  • 47

                  #9
                  timer

                  I saw this older post on the timer counter and it is nice. I was using it to jump to another page in 10 seconds if the user doesnt click on anything, but as soon as the user rollsover something the page seems to jump to the end of the timer and boom jumps (I have some other things happening on the On Timer also with rollover fades and Set Opacity. But I can't understand why that effects the timer. Any ideas?

                  Comment

                  • yosik
                    Indigo Rose Customer
                    • Jun 2002
                    • 1858

                    #10
                    If you post your project, we may be able to help you.
                    in any case, it looks like you have a "rollover" event. Do check your code for that rogue action.

                    Yossi

                    Comment

                    • willfreer
                      Forum Member
                      • Aug 2004
                      • 47

                      #11
                      Timer

                      Thanks for the help, this is my last resort before giving up and turning it over the Director person.

                      It is basicly a project with 7 videos (each on a page) looping with a short swf in between each. But it has a menu button on each page that can break the loop and take the person to the menu page. After a set time (I have 3 seconds for now for testing) if the user hasn't chosen a video, it jumps to the first page and starts the loop again.

                      Currently the code will hold on the menu page for 3 seconds, But I have all this fancy rollover button fades on the menu page using
                      Code:
                      FadeIn_[18]=1;
                      Page.StartTimer(TriggerTime);
                      that seems to short circut the onTimer from waiting 3 seconds. After the rollover it jumps directly the Page.Jump page.

                      here is the code on that page, and also for one button.

                      Thanks again for looking at it.

                      the page.

                      on Preload (code for fading in and out objects)
                      Code:
                      totalImages=19;
                      
                      FadeIn_={};
                      for count=1,totalImages do
                        FadeIn_[count]=0;
                      end
                      
                      speed=90;
                      
                      TriggerTime=10;
                      on Show: counter info and various image opacity:
                      Code:
                      count = 0;
                      Page.StartTimer(3000);
                      Image.SetOpacity("loading", 0);
                      Image.SetOpacity("IM9_A", 100);
                      Image.SetOpacity("IM11_B", 0);
                      etc....
                      OnTimer
                      Code:
                      count = count + 1000;
                      if count == 3000 then 
                      Page.Jump("SEAR_swf");
                      else
                      allDone = 1;
                      
                      for x=1,totalImages do
                        
                        if (FadeIn_[x] == 1) then
                          Image.SetOpacity("IM"..x.."_A", Image.GetOpacity("IM"..x.."_A") - speed);
                          Image.SetOpacity("IM"..x.."_B", Image.GetOpacity("IM"..x.."_B") + speed);
                      
                        elseif (FadeIn_[x] == -1) then
                          Image.SetOpacity("IM"..x.."_A", Image.GetOpacity("IM"..x.."_A") + speed);
                          Image.SetOpacity("IM"..x.."_B", Image.GetOpacity("IM"..x.."_B") - speed);
                      
                        end
                        if (Image.GetOpacity("IM"..x.."_A")<100) then
                          allDone=0;
                        else
                          FadeIn_[x] = 0;
                        end
                      end
                      if allDone==1 then
                       
                      end
                      end

                      Comment

                      • yosik
                        Indigo Rose Customer
                        • Jun 2002
                        • 1858

                        #12
                        From your code, it looks like you are cancelling your own commands.
                        Under the onShow event you launch your timer with a 3000ms time range. But THEN under a rollover event, you launch the timer again, this time with 10ms time range. AMS doesn't know you want two different timers, thus it launches the only timer existing and with 10ms wait, you jump instantaniously to the next page.

                        That is your problem.
                        Solutions can be many:
                        1. You can use Worm's multi timer plugin (you need to buy it)
                        2. You can delegate the fading of your buttons to Flash (create fading buttons in Flash and import them to AMS), thus freeing your Timer to do what you want it to do.
                        3. Not use a timer at all for your fades. Instead, use a "while" condition to change the opacity on your button. Don't forget that you can create a function and use the generic word "this" for it to apply to the button you just rolledover.

                        Hope that helped

                        Yossi

                        Comment

                        • willfreer
                          Forum Member
                          • Aug 2004
                          • 47

                          #13
                          timer

                          Thanks for your response.

                          I will review your options and decide what to do. I think it would take me a day to get all the pngs and graphics and put them in Flash and do it. And since I am more of a ActionScript programmer it will take me quit some time to write the while loop in AutoPlay. So I will check into the function that since it is so close in AutoPlay I wll check iinto Worms plug in.

                          thanks.

                          Comment

                          • willfreer
                            Forum Member
                            • Aug 2004
                            • 47

                            #14
                            timer

                            I downloaded the timer but I can't figure out how to reference the 2 timers (the one on rollout event, and the one that holds the chart) to the timer code in global.

                            I will keep trying, thanks.

                            Comment

                            • Worm
                              Indigo Rose Customer
                              • Jul 2002
                              • 3971

                              #15
                              From what I see, the issue is that you change the timer interval from 3000 ms to 10 ms when you roll over a image. The timer therefore fires much faster and count reaches 3000 (within 30 ms) causing the jump to the next page.

                              Start your timer at the lowest interval (10 ms) in your On Show (not 3000), then change your counter code in the On Timer to this:
                              Code:
                              count = count + 10;       --add up the miliseconds
                              if count == 10000 then   --has the timer been running for 10 sec? 
                              --jump to page
                              else
                              --do your image opacity fades
                              end if
                              HTH
                              Last edited by Worm; 08-16-2007, 09:43 PM.

                              Comment

                              Working...
                              X