PDA

View Full Version : help needed to alter statement for suitability



stroodle
May 5th, 2009, 10:31 PM
Hi there.
Just a simple query really. I would like to fully understand the functionality of a friends application he built using Flash. He made me aware that he used an open source Flash file for the interactivity of this file. Whilst riffling through it, i noticed part of actionscript code that seemed alien to the nature of the application. For example:

on (release)
{
_parent.city.ty = 185;
_parent.city.change = "yes";
_parent.golf.change = "no";
_parent.mount.change = "no";
_parent.yacht.change = "no";
_parent.city_sub.gotoAndStop(1);
_parent.golf_sub.gotoAndStop(1);
_parent.beach_sub.gotoAndPlay(2);
_parent.mount_sub.gotoAndStop(1);
_parent.yacht_sub.gotoAndStop(1);
}
this chunk of code ensures the list of destinations are displayed under its respective button after it has been pressed. If i change the all of the 'yacht', 'beach', 'mount' and so on, the list fails to appear. I would like to know how the

_parent.city_sub.gotoAndStop(1);
_parent.golf_sub.gotoAndStop(1);
_parent.beach_sub.gotoAndPlay(2);
_parent.mount_sub.gotoAndStop(1);
_parent.yacht_sub.gotoAndStop(1)

statements manipulate the lists, and weather the names like 'yacht', 'beach', 'mount' and so on, can be changed into more suitable words like 'buildings', 'parking', 'misc' and so on, to suit the theme of the application.

If need be, the file i am working on can be accessed here:
http://intasp.bcuc.ac.uk/20527796/interactive_campus_map_final.fla

Any help with this issue will be greatly appreciated, thank you!

glosrfc
May 6th, 2009, 05:55 AM
Of course you can change the names...but you must ensure that you also change all of the corresponding instance names too, otherwise the relevant movie clip won't be targetted.

For example, if you change a reference in the code from golf to buildings, you must also find all of the movieclips on your stage with the instance name 'golf' and change those to 'buildings'. You can either do this manually by hunting them all down using the Movie Explorer panel, or do a search for a Flash Extension that can do it automatically for you.

As for the gotoAndStop commands...they don't "manipulate" any lists. What they do is instruct the playhead of the targetted clip (e.g. the clip with the instance name 'golf_sub' that resides inside the '_parent' movie clip) to move to the first frame (1) and stop there. In the meantime, the gotoAndPlay command instructs the 'beach_sub' child clip to goto the second frame (2) and commence playing.

stroodle
May 6th, 2009, 02:41 PM
Thank you very much glosrfc, your a life saver. I had to find the movie clip via the 'find and replace' way.