Announcement

Collapse
No announcement yet.

MP3 on load page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MP3 on load page

    Hey, probably a pretty simple question to answer.

    I have a main menu, which it set the onLoad event to load an MP3.. you can go on from this main menu to other pages with the music still playing.. however if you return back to the main menu from one of these pages it restarts the MP3 (obviously) because of the onLoad page event... is there a way to get around this and simply continue playing the song when you RETURN to the page?

    Thanks

  • #2
    Re: MP3 on load page

    One way to do this is is to set up the action in conjunction with an if statement. Something along the lines of....

    Onload:

    If %Play% != 1
    Play your MP3
    Set %Play% = 1
    END IF

    Here's what the AMS code would look like....

    <IR_ACTIONS_LIST>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%Play% != 1</Condition>
    </Action>
    <Action name="Load">
    <Type>105</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <MP3File>%SrcDir%\MyMP3.mp3</MP3File>
    <External>1</External>
    </Action>
    <Action name="Play">
    <Type>106</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Play%</Variable>
    <Value>1</Value>
    <Evaluate>1</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    </IR_ACTIONS_LIST>

    Comment


    • #3
      Re: MP3 on load page

      I think he meant he want's a "pause" on the MP3 until the user returns to that page, at which point it resumes.

      This is very simple to do using a Flash Object, I think you could do it pretty easily with an MP3 object too. You could use an MP3 > GET PROPERTY > PROGRESS action to store the current MP3 playhead location into a variable, i.e. %timeMarker% and then all you have to do when they return to the page is use an MP3 > SEEK action to restore the playhead to that %timeMarker% marked position and then an MP3 > PLAY action to let 'er rip... Sandwich that in an IF conditional to confirm where they are coming from and you're in business.

      Nice and simple, should only take a few minutes to implement...

      Corey Milner
      Creative Director, Indigo Rose Software

      Comment


      • #4
        Re: MP3 on load page

        good call. thanks.

        Comment


        • #5
          Re: MP3 on load page

          actually he answered my question (it was an easy answer as expected).. i should have thought of it myself, but i wasn't thinking at the time i guess... thanks to both of you anyways.

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎