Flash and passing variables to a movie from a php page

heys all.

Right. This is an oldie but a goodie. (well. not really a goodie. more like an out of date cookie with a little mould on it. kinda.)


I've got a flash navigation movie (ie a bar with menu options on with a little bar that moves underneath the menu option that corresponds to the current page).

making the bar respond to a mouse rollover of the menu item is working fine.

given a variable in the script
currentpage = 4;
if (currentpage==4)
<make bar go to this position>

then the bar will obediently go to that position.

However. I cant get this function above to respond correctly when the variable is not defined in the script, but defined by either

1) loadvariables from a php script (the script returns    currentpage=4    )
2) hardcoding the variable into the html object reference.

All this works fine, of course, when placing the variable into a dynamic text box but i cant get this damn thing to work when simply trying to test the damn thing.

Any ideas please?

thanks very much

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

>Any ideas please?

yep, you are using the variable *before* it has been loaded. How are you using it (the script)?
darynAuthor Commented:
definitely using it _after_ i've run the load command.

the load command is based in the first frame of the "first" layer that existed in the animation (ie the bottom layer).

the command to move the bar to the desired position, depending on the condition, is in the actionscript attached to the bar itself.
Wait, I'm sure that you try to use it after the load command, but not sure that:

- you are using it after it has been loaded
- you are using it in the desired format.

For example:

data_var = new LoadVars();
data_var.onLoad = function(success)
      if(success){ // data has been loaded
            if(Number(this.currentpage) == 4){ // convert it to a number, as it's loaded as string
                  // do something
            } else {
                  // do something else
      } else {// data has *not* been loaded
            trace("PHP FILE MISSING");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
darynAuthor Commented:
thanks very much
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.