[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

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

  • 2
  • 2
1 Solution
>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");
darynAuthor Commented:
thanks very much

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now