Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-31-2008, 07:11 PM   #1
KISSklas
Registered User
 
Join Date: Mar 2008
Posts: 2
Post [AS3] Platform game array scrolling

Hey. I'm trying to scroll a whole array of randomly placed items with the rest of the level. But it wont let me do that!

this is my function:

Code:
public function movelevel()
{
	if( _player.x < 50 && move_left == true  )
				{
					
					_player.x +=10;
					
					
				}
			
        if( _player.x > 600 && move_right == true )
				{
					lava.x -=10;
					bg.x -= 5;
					_player.x -=10;
					_ground.x -=10;
					level.x -=10;
					_enemies.x -= 10;
					_items.x -= 10;
					_platform.x -= 10;
				}
}
And here is my error, which goes on forever:

Code:
TypeError: Error #1006: value is not a function.
	at main/checkHitTest()
	at main/update()
There is some nasty little loop, but i am a AS n00b so I dunno how to fix it. Is there a good way to move a whole array simple?
KISSklas is offline   Reply With Quote
Old 03-31-2008, 08:09 PM   #2
dr_zeus
Feathers
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,999
Default

The error seems to be happening at checkHitTest(). Maybe you should post that function too since there are no function calls in movelevel().
__________________
Josh Tynjala | Feathers
dr_zeus is offline   Reply With Quote
Old 04-01-2008, 03:35 AM   #3
KISSklas
Registered User
 
Join Date: Mar 2008
Posts: 2
Default solved

I solved it evetually.

If anyone has the same problem here is what i did:

Code:
var items : int = _items.length;
for (var i : int = 0; i < items; i++) 
					{
  						_items[i].x -= 10;
					}
Now the whole array moves.
KISSklas is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Platform game - not working as intended! bloodstyle Gaming and Game Development 0 03-21-2008 07:09 PM
[AS3] how this game avoids tearing when scrolling? coltsith Gaming and Game Development 1 03-07-2008 11:54 AM
FlashGameLicense.com - virtual marketplace to connect game developers and buyers AdamSchroeder General Chat 0 12-18-2007 09:16 PM
problem creating mc instance names inside a function jasonyen ActionScript 2.0 10 12-08-2004 12:01 AM
trouble with variable getting lost whoo Simple Stuff (Newbies) 2 08-07-2004 05:52 PM


All times are GMT. The time now is 07:43 AM.

///
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.