|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
Hey, i will use javascript to post an event from my HTML page
when i use this interactor <MTSInteractor Name="sound_ready"> <MTSHandle Event="test" Action="MTSJavaScript" Func="alert('test');"/> </MTSInteractor> I will get an alert window that says "Test" However what i wish to do is send something to a flash control i have so i have <MTSAction Name="playSound" > <MTSAssignProperty Target="MTSTimeElem.bar_loader.SWF._root.here.playBar(2000)" /> </MTSAction> <MTSTimeElem Type="SWFView" Name="button" On="1" PostAnimator="1" Path="button.swf" Loop="0" /> <MTSInteractor Name="play_sound"> <MTSHandle Event="test" Action="playSound"/> </MTSInteractor> These functions do work, except when i try to trigger them using javascript in HTML with PostEvent anything i'm doing wrong here? |
||
|
|
Member |
Just as an aside i am actually using this code in the html
var name = 'test'; var delay = '5'; var cmdstr = "PostEvent (" + name + "," + delay + ")"; function sound() { vmp.Execute(cmdstr); } It might be that this function comes way too quickly before anything else gets a chance to load, but how would i delay it further? every time i change the delay number i get the same problem. |
|||
|
|
Member |
Hello,
Is there any reason why you have to do the post event using vmp.Execute? If not, I would suggest doing it with vmp.PostEvent like so: var name = 'test'; var delay = '5'; var cmdstr = "PostEvent (" + name + "," + delay + ")"; function sound() { vmp.PostEvent(" + name + "," + delay + "); } Let me know if that works. For complete reference on javascript commands made available to interface with the VMP through MTS3Interface.js, refer to the Viewpoint Rich Media Authoring Guide, pages 161 - 163 |
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

