0
Under review
How to use this function dynamically setLink()
Hi all,
I have created scene in my account,also i am able to set value for "href" from scene setting,
But i want know how we can do it using setLink() function for dynamic purpose?
Customer support service by UserEcho
Hi Sachin -
The SitePal support page includes an API example that demonstrates this functionality -
http://www.oddcast.com/support/setLink_setTarget.html
Hope this helps,
Gil
The SitePal Team
Hi,
I have created scene and published it, it is javascript code.
from where we can call setLink(""); function with custom URL?
Q1. We want to change the following value dynamically as soon as the scene loads. So for that we are writing the following snippet of code in the vh_sceneLoaded(sceneIndex) function. But these functions are never called. If we put an alert in this function we are able to get the alert. But if we try to change the value say we make "followCursor(2)" then the behavior is still same as that of "followCursor(1)" . Similarly with other functions. Can you please tell us how we can change or call these functions at run time.
Snippet:
function vh_sceneLoaded(sceneIndex)
{
followCursor(1);
setGaze(180,10,1); //default
setFacialExpression(1, 10, 100); //expression , duration, amplitude
setIdleMovement(50,50); //default
//setSpeechMovement(50); //default
setLink('http://www.google.com');
//SetTarget('_blank')
setStatus(0,0,0); //default
}
Q.2 In the above snippet: setSpeechMovement(50); and SetTarget('_blank') functions give error if un-commented?
Can you please guide us where we are doing wrong. ?
Hi Sachin -
Can you post a link to your page where we can review this functionality?
Are you using a full body or classic character?
I ask because the full body character does not support some of these functions - specifically -
* setGaze
* setFacialExpression
* setIdleMovement
Are not supported for Full Body characters.
setLink & setStatus should work though.
Gil
Hi Gil,
Currently, we have integrated it in our local environment, so we are not able to share the link. but we are using classic character.
But in the link which you have shared with us "http://www.oddcast.com/support/setLink_setTarget.html" can you please let us know if i have to change say "followCursor(1) to followCursor(2) how can i achieve that ?
My thinking is that we have to call the function "followCursor(parameter)" ? How and where we have to call this function ? So that we can see the change.
Also please let us know if the function name we are using is correct ?
Hi Gil,
Thanks for valuable time and support.
Below Snippet works as expected, But we are not able to set "setSpeechMovement(50)" function, it throws error.
And One more thing I want to do in my code is set "Model" dynamically.
Ex. Model -"Angela"
Can you please tell us how we can change or set "model" at run time?
function vh_sceneLoaded(sceneIndex)
{
followCursor(1);
setGaze(180,10,1); //default
setFacialExpression(1, 10, 100); //expression , duration, amplitude
setIdleMovement(50,50); //default
//setSpeechMovement(50); //default
setLink('http://www.google.com');
setStatus(0,0,0); //default
}
Hi Sachin -
Without seeing your page I'd need to speculate.
Are you using 3D or 2D classic character?
The 2D character does not support setSpeechMovement and may return an error.
Loading a model dynamically -
The only way is to switch the Scene using the loadScene function call.
Hope this helps!
Gil
ps. would be great if you could create a public version of your page where problems could be seen.