PDA

View Full Version : how to read js true,false condition in actionscript?


dulcinea
05-16-2005, 07:41 AM
hi there,..i really need your help on this:

i use this script to open js function in html page,
getURL("javascript:chkdsk()");

this is d function in js,

function chkdsk()
{
while (!document.applets["WriteFile"].chkdsk())
if (!confirm( "Sila masukkan disket anda!")) {return false;}

return true;
}

d problem is...how can actionscript read d returned value from js?
thanx in advance ;)

Ruben
05-16-2005, 10:08 AM
Maybe have a try with this?*

function chkdsk(){
while (!document.applets["WriteFile"].chkdsk()){
if (!confirm( "Sila masukkan disket anda!")){
var myValue = false;
}
var myValue = true;
}

var myVariable = 'someVar';

window.document.myMovie.SetVariable(myVariable,myV alue);
window.document.getElementById('myMovie').SetVaria ble(myVariable,myValue);
}

The above example sets the variable someVar (stored in myVariable) in the SWF with the id myMovie to the value of the variable myValue.
Note that you should name your movie myMovie before this will work.
Also note that I'm not sure if it supports all browsers, I'm pretty sure it'll work for IE and firefox though...

:) - Ruben

dulcinea
05-19-2005, 02:33 AM
hi ruben,
thanx..its really work on my scriptw ;)

Ruben
05-19-2005, 10:11 AM
No problem

:) - Ruben