Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VMP for Macintosh    Javascript and Mac

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<i_bob>
Posted
I try to use one javascript function to trigger one animation depending on the today's date.
As I am lazy , i use code like the one you write for the demo where you change the texture of a cube with a local jpg:
var str = ('[MTSTimeElem Type=\\"MTSImageStream\\" Name=\\"streamnewpic\\" On=\\"1\\" Path=\\"maps/' + jour + '.jpg\\"][Target Name=\\"MTSTexture.noir\\"/][/MTSTimeElem]');
vmp.Execute(str);
vmp.TriggerAnim('streamnewpic');
I works perfectly on Windows but not with Mac, ... WHY??
TIA
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi i_bob,

just tried your code snippet, shouln't you get rid of a few of those \'s?

for me (at least) \\" translates to \" in the string which the VET player won't be happy with. Alternatively, I have been happily using the following methods for a week or so ;-) :

var path= 'maps/'+jour+'.jpg';
var str= MTSMarkup('Target','','Name','MTSTexture.noir');
str=MTSMarkup('MTSTimeElem',str,'Type','MTSImageStream','Name','streamnewpic','On','1','Path',path)
vmp.Execute(str);

In essence this gets the player to build its own xml and then execute it and should avoid the multiple quote marks problems.

I'm not sure you'll need to trigger the animation with the vmp.TriggerAnim call since you already set the animation to on.

If you do need to trigger the animation maybe it'll need a little time. Otherwise I can see the player on the Mac at least going 'hmm, WHAT animation?'.

Good Luck,

Barnaby
 
Posts: 133 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VMP for Macintosh    Javascript and Mac