简体   繁体   中英

Different functions for different sprites in 1 fla file code on flash

i am creating a game using flash cs5 and a part of it is drag and drop. in the game, we have this so called sprites. if you clicked on sprite 1, the topic for the drag and drop game is like for example, science. and once done and when you clicked on the other sprites, the subject assign would be for example arts.

so this is my question. is it possible to create 1 fla file in flash cs5 where in it contains all the possible commands for drag and drop game for all sprites? you see, i have a main fla file which is the main game this calls the other files or activity, and some other fla file which is the activity in the game like question and answer, puzzles and the likes.

i am having an idea about inserting each question game in different frames to make the code shorter and to avoid having to duplicate the code for the other sprites. or in other words, every time the user clicks the sprites assigned to that specific activity, it will call the specified frame that corresponds to the instance name.

again, the sprites are located on the main fla file. when clicked, it calls another fla file containing the game and at the same time, getting the value of the sprites ti know which frame should it proceed to. and thus returning the score attained in the minor fla file to the main fla file after the end of each activity.

i am not yet using codes here, because i am not sure if this is possible, so i started with the GUI. i hope someone could answer my problem.

I suppose you dont have much experience with as3, so for start i recommend you to check out this link:

http://gamedev.michaeljameswilliams.com/2008/09/17/avoider-game-tutorial-1/

Its not for drag'n drop game, but its great tutorial about as3. And i believe, if you wish to make any kind of game with Flash, you need to know basics with as3.

Anyways.. It is not just possible to make the whole game inside one fla, but its actually very best idea for small games. You can also make own frame for each question, but code is much more practical and flexible way to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM