View Full Version : Javascript to Flash to ASP
Lanie
01-07-2003, 10:46 PM
I'm new to Flash and would appreciate any help.
I need to change a property of a var in flash from Javascript then have that event fire off a query to an asp from flash without using a button.
The javascript is:
function makeinvisible() {
myFlash.TSetProperty("gender_cb", 7, 0)
}
So as soon as gender_cb is turned invisible, I need flash to query a database automatically.
Lanie
jimburton
01-08-2003, 10:16 AM
add a variable to say whether the change has been made and check it on every frame:
// javascript
function makeinvisible() {
myFlash.TSetProperty("gender_cb", 7, 0)
myFlash.setProperty("triggered",true);
}
// in flash on first frame main timeline
onEnterFrame = function() {
if(triggered) {
// do all your stuff
}
}
note that if you had already created the variabled triggered by saying
triggered = false;
and then set it to true, even though you send a boolean from flash it comes in a string and you have to check it as such [ie if(triggered == "true") rather than if(triggered).]
Lanie
01-09-2003, 03:41 AM
Thanks for the help...but I have tried all day do this and can't make it work. I must be missing somthing. I am trying to do this using IE 5.5, if that makes a difference. Your JS code said
"myFlash.setProperty("triggered",true);"
When I try this I get and error: "object doesn't support this property or method"...so I tried "myFlash.TsetProperty("triggered",true);" (notice the .Tset) which I thought would fix it and I get error "wrong number of arguments or invalid property assignment"...I put quotes around the true, tried to use 0 instead of true, tried to use TgetpropertyAsNumber...nothing I could think of would make it work. It seems like it is really close, but I don't know what else to try! any ideas anyone?
jimburton
01-09-2003, 09:54 AM
:o apologies Lanie it is SetVariable....see http://www.macromedia.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html
Lanie
01-09-2003, 11:51 PM
That worked!!! thanks :)
|
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.