PDA

View Full Version : Stitching SWF's to create seamless keyboard activated background


stacy925
10-02-2005, 06:14 PM
Hi
Thanks for any help in advance struggling through my first game here...

I want to load a number of external swf's into a movieclip that I can control with the keyboard. I have two problems.
Firstly when I control a movie clip with the arrow keys it works but not when that movie clip has an external swf loaded into it.
My second problem is the loading. Basically each scene has a background in the game (with animations contained within) The file size would be big to join them all up in flash so I think laoding externally solves the problem. However when the user goes forward with the arrow I want the background to look seamless. How do detect if one swf is about to move off the screen and attach the next swf to the right of it so that the next swf then comes into view.

I am new to actionscript (about 70 pages through training from the source book at present) so any help regarding flow of this game would be appreciated as well as some scripting hints

Regards
Stacy

madgett
10-03-2005, 03:16 AM
1) When you load a.swf into b.swf, b.swf completely replaces (deletes) any actions associated with a.swf. The solution to this is make a container movieclip then a child movieclip which you would then load b.swf into, and apply actions to the container.

2) use setinterval or onenterframe to detect the swf _x,_y positions and when it becomes greater than Stage.width or Stage.height load the next swf.

stacy925
10-03-2005, 03:17 PM
Thanks very much for the first tip - i have made a child movieclip within the container and now I can keyboard control the external swf's - Now to the x y position tracker

THANKYOU!