Topic: using flashVars to access current image info from javascript

Hi, I want to access the path of the current image from javascript.  I have tried a couple of methods but the method that seems would be easiest would be to:
- add a flashvar called curImage,
- update the value of this variable within class on image load
- in my HTML I could read the flashVar at any time using getVariable.

Here is what I did:

In my HTML I added

   fo.addVariable("curImage", "grue");

In the class I added a line to set the value of this variable to 'foo'

   public function loadImage(loadNextonDone:Boolean){    
        mLoadNextonDone = loadNextonDone;
        //start loading image
        mLoader_mcl = new MovieClipLoader();

        _root.curImage='foo';   // <<<<--------

        mLoader_mc._visible = false;        
        resizeImage&#40;&#41;;//center loader

When I run this function I always get grue and not foo like I would expect. 

   function whatImage&#40;&#41;&#123;

What gives?

All ideas welcome, thx.

Re: using flashVars to access current image info from javascript

This is getting intensely frustrating.

I am trying another method that all the docs say should work but it doesn't and I get zero feedback from flash telling me whats going on.

I am trying this now.
In the class I am adding

import flash.external.*;

and then calling;"whatImage"&#41;;

the javascript function on my page is simply:

    function whatImage&#40;&#41;&#123;

I save, publish the viewer, refresh the page. the viewer loads and the images load but I get nothing.  I would be nice to get an error telling me what the heck isn't working but I get nada.

I just want this one simple functionality and I have wasted a whole day on it. Doesn't anyone have any ideas?

Re: using flashVars to access current image info from javascript

Apparently running locally was the problem.  Using the external interface works fine when running on my web server.


Feature suggestion:
Add call back functions that can be called from javascript to return properties of the currently selected image.