Accessibility

TechNote (Archived)

Goto actions may not work with expressions in Macromedia Flash Player 5

Issue


A movie containing a goTo action that uses an expression for the target frame may not work properly in the Macromedia Flash Player 5 if the first character resolves to a number.

Note: This is an issue with the Flash Player prior to version 5,0,41,0. The problem was fixed with the latest release of the Flash Player (December 2000).

For example, in a Flash 4 movie , if a frame was given the label "3_Contents", the following code would send the playback head to that frame label:

 Set Variable: "index" = "3" Go to and Stop (index & "_Contents") 

However, in the Flash Player 5, this code example would cause the playback head to jump to frame number "3", and not frame label "3_Contents".

Note that in Flash 5, the concatenation operator has changed from the & operator to the + oradd operator, to be consistent with JavaScript syntax.

Reason


If the expression part of a goTo action consists of the concatenation of a number and a string, in that order, the Flash Player 5 incorrectly evaluates the expression as the integer value of the first character.

Solution


The expression will evaluate correctly if the order of the concatenation is reversed from 'integer + string' to 'string + integer'.

Practically speaking, this would mean that in the example discussed above the frame label '3_Contents' would need to be changed to 'Content_3' and the code example would need to change to the following:

 Set Variable: "index" = "3" Go to and Stop ("Contents_" & 3) 

Additional Information


For more general guidelines for naming objects, please refer toNaming strategies for Flash (TechNote 14727).

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_14719

Products Affected:

flash