Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-07-2010, 05:39 PM   #1
Registered User
Join Date: Oct 2010
Location: Bournemouth UK
Posts: 1
Default Symbol to load new layer?

Right so I'm a noob when it comes to AS, I've done some simple flash animations before using tweens etc. I've done a lot of HTML work, some PHP and some Java.

I'm in the middle of a small personal project developing a Platform game in Flash CS4...

here is the game so far - rollock. stormloader . com (without spaces - I'm a tad low on posts!)

if you go to the end of the level, (past the spikes) there is two platforms, on the second I'm hoping to put a star or circle to change the ground layer and reset the character.

all of the brown squares with green stroke and the ladders are on one layer. Then the character on another and so on.

Now my problem lies in I'm not quite sure what AS to apply to the circle/star to change the ground layer to a new 'track' to play on.

If any body can help me, or give me a step by step tutorial that would brilliant!

Thanks in advance,
ZockAvenger is offline   Reply With Quote
Old 10-12-2010, 07:08 PM   #2
I love Actionscript
Join Date: Jul 2009
Location: CT
Posts: 101

First, your game is awesome and runs pretty well.

I can't write a step by step tutorial, but what you should do, is build your levels as MovieClip's in your library. Export them for Actionscript by giving each one a class name. So if you have 2 levels one might be Level1 and the other might be Level2.

in your code you would say
ActionScript Code:
var lvl1:Level1 = new Level1(); var lvl2:Level2 = new Level2(); addChild(lvl1);

so when you want to change to level 2 you would remove level 1, and add level 2 in its place

ActionScript Code:
removeChild(lvl1); addChild(lvl2);

When building games it is important to know some basics about object oriented programming. Did you do any OOP programming in Java or PHP?
Rada is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:29 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.