PDA

View Full Version : [FMX] External Variables



kBisk
December 19th, 2004, 05:55 PM
Hi, I'm working with Flash MX 2004. I have a funtional monthly calendar that does not use external variables - all variables are contained within the timeline. I am now trying to control it with external variables using:

loadVariablesNum("visualControl.txt",0);

The contents of the text file are:

&InitialMonthVisable=dec&
&janYear=2005&
&febYear=2005&
&marYear=2005&......

The InitialMonthVisable variable is used to define which month is visable first using dec=december, jan=january, etc. This is needed because the first month visable will not always be the current month.

There is a movieclip on the main timeline with 12 labelled frames (dec, jan, feb, etc) and uses the IntialMonthVisable variable in the first frame:

this.gotoAndStop(_root.InitialMonthVisable);

The movieclip then goes and plays the specified month. This works fine when the variable is defined within the movie, but the movieclip does not play the specified month using the external variable.

Is there something I am doing wrong or something I'm not doing?
Any help would be greatly appreciated.

glkngs
December 20th, 2004, 03:13 AM
Are you sure that the variables are loaded before you tell the mc to "gotoAndPlay"?

kBisk
December 20th, 2004, 08:07 AM
Thanks glkngs. I got it working now by inserting some blank frames before the gotoAndPlay action.