Javascript setVariable nightmare

hi all,
i have a button in my html page passing in a variable via the javascript “window.document.skimpieVision.SetVariable(“prodID”, “jumper”)” command.
flash picks this up fine in a textfield which is called prodID, but not a normal variable called prodID. i’ve been through stacks of documentation on the flash methods, and no mention of any problems. is tehre something reallt simple i’m doing wrong, or can you only pass a variable this way to a text field?
cheers

  • D

hmmm, that seems weird to me, maybe something to do with levels?

another method is to use FlashVars–this is a MX method that allows you to pass a var to flash using the ‘object’ and ‘embed’ t tags in html–there’s a tutorial available on ultrashock.com–go to: tutorials/mx/flashvars’

i’m not sure if this will work for you, but it’s worth checking out…
-mojo

hi mate, thnx for replying…
unfortunately i’m exportuing it as a flash 5 movie. theres nothing that needs to be mx specific (although it would make things easier). and i dont want to alienate a load of flash 5 plugins just because i cant get a couple of variables into my flash movie.
i have used flash vars before and think theyre wicked, but maybe theres another way. i’ll go back to the drawing board!
any ideas would be much appreciated as i’m running out of hair!

  • gBay:trout:

i hear ya on the mx vs 5 issue:smirk:
i can imagine you’re going insane on this–it shouldn’t be an issue, but i’ve been there…
a couple of stupid/simple ideas:

have you used the debugger to look at vars/levels? sometimes this pops up something suprising, altho i hate the debugger!

maybe its something stupid like this:
window.document.skimpieVision.SetVariable("_level0.prodID", “jumper”)

it’s gotta be something little–don’t go crazy, it’s gotta be there somewhere…(-:
-mojo

hi mojo,
i’ve never got on with the flash debugger to be honest, so i never bother using it. i havnt checked it out in mx, maybe they actually got it to work!
but… i did get it to work! i had only one frame in my movie, so when i clicked teh button thats passes the vars in, the movie had already played! so now i’ve got 2 frames in my movie, and in my javascript i’ve got:

window.document.skimpieVision.GoToFrame(2);
window.document.skimpieVision.Play();
window.document.skimpieVision.SetVariable(“prodID”, “3”);
window.document.skimpieVision.SetVariable(“col”, “1”);

this just plays the movie and feeds in the vars, which are picked up and displayed on the next frame.

a bit silly really.:whistle:

  • gBay

hah! it’s great you finally got it–it’s ridiculous how those things make you curse and shout, and then finally, after you swear you’ve done everything…you figure it out–good for you=)

afa, the debugger, it’s a piece if s#$t, but every now and then i use it and it shows me something useful–i wish they could make it more stable, as i’d love to be able to use it properly…
regards,
-mojo