I need help in shootorial 2

Subscribe to I need help in shootorial 2 23 posts, 11 voices

Sign in to reply


 
avatar for hb2007 hb2007 30 posts
Flag Post

I need help in shootorial 2, i drew my own background which is only as large as the game screen ( my game screen is 840*300 and not 600*300) on page 7 of the tutorial we have to fix the scrolling background by looping, my looping doesnt work, i copied and pasted the commands, i tried to replace the 2110 with 840 as the width of my background but it didnt work. Can anyone help?

 
avatar for MoonlaughMaster MoonlaughMaster 3277 posts
Flag Post

screenshot, perchance? Your code? More info?

Then I can help you.

 
avatar for hb2007 hb2007 30 posts
Flag Post

ok here it is,
I have called my project pencil and not ship,
I cant find a way to show you a screenshot except e-mail, any way here is the code:
class background extends MovieClip
{
function onEnterFrame()
{
x -= 1;
if(
x < -840)
{
_x = 0;
}
}
}

 
avatar for t2t2 t2t2 22 posts
Flag Post

(upload images to http://imageshack.us/)

I think maybe for that small width background (as wide as game) is a bit bad, try adding 3rd copy of background.

 
avatar for hb2007 hb2007 30 posts
Flag Post

doesnt work, itried to copy the image and update the actionscript with new width but no use!
[URL=http://img355.imageshack.us/my.php?image=capturesh8.png][IMG]http://img355.imageshack.us/img355/267/capturesh8.th.png[/IMG][/URL][URL=http://g.imageshack.us/thpix.php][IMG]http://img355.imageshack.us/images/thpix.gif[/IMG][/URL]

 
avatar for hb2007 hb2007 30 posts
Flag Post

Image Hosted by ImageShack.us
By hb2007 at 2008-10-19

 
avatar for t2t2 t2t2 22 posts
Flag Post

You still haven’t told what the problem is through, Is it jumping at wrong place or something?

 
avatar for kloma kloma 3 posts
Flag Post

no, it doesnt loop

 
avatar for kloma kloma 3 posts
Flag Post

hb2007 said:my looping doesnt work,
hey hb try to copy the background a lot of times to the right and then try looping it.

 
avatar for hb2007 hb2007 30 posts
Flag Post

You are right kloma my background doesnt loop, I tried your suggestion but it still didnt work!

 
avatar for rudolf13 rudolf13 1 post
Flag Post

classnames are case sensitive so you must make sure that your movieclip classname is background and not Background or something like that. also in your screenshot you haven’t saved your file. Flash can only read the version you saved the last. it can also be that the files aren’t in the same folder. that’s all i know about it. I hope it helped

 
avatar for hb2007 hb2007 30 posts
Flag Post

nothing works, is there any other way i can loop the background? in tutorial they say it is the easiest way, is there any harder, working way?

 
avatar for Jspapp Jspapp 1 post
Flag Post

Is the background moving but not looping?
If its that, then you need to make a background that loops seamlessly into itself.

 
avatar for t2t2 t2t2 22 posts
Flag Post

Here’s a code I use:
EDIT Only works if image width is smaller than width of the game!

	function onEnterFrame()
	{
		_x -= 1;
		if(_x < -[width of the game]) {
			_x += [width of the image];
		}
	}

(also note that total width of background images must be larger than game width*2)

Btw as in “doesn’t loop” does the background appear 2 times and then it turns white?

 
avatar for chaos548 chaos548 16 posts
Flag Post

i also have this problem…
on the 3rd loop it turns to white…

 
avatar for hb2007 hb2007 30 posts
Flag Post

btw your code shall be:
function onEnterFrame()
{
x -= 1;
if(
x < -[width of the game]) {
x += width of the image;
}
}
and not:
function onEnterFrame()
{
_x -= 1;
if(
x < -[width of the game]) {
_x += [width of the image];
}
}
anyway doesnt work! ntohing!

 
avatar for hb2007 hb2007 30 posts
Flag Post

hey jsapp my backround is moving and not looping, make a background that loops seamlessly into itself.
how?

 
avatar for mldnlght mldnlght 1 post
Flag Post

I have the same problem, I’ve tried multiple solutions too (copy pasting the coding for actionscript from the sourcefile).
I even tried opening the shootorial source .fla (test movie looped nicely), then replaced the background with my background (including the symbol and all that), and suddenly, it wouldn’t loop anymore.
It’s quite annoying really =\

 
avatar for Grape Grape 45 posts
Flag Post

The problem is that the word “background” is a special keyword in flash and cannot be used as a name of a class. See how it’s in blue? If you capitalize it or make it background_mc then it should work fine.

 
avatar for hb2007 hb2007 30 posts
Flag Post

thanks a lot Grape finally i knew the solution, you really helped.

 
avatar for garetjax13 garetjax13 2 posts
Flag Post

okay, i have done everything, i copied letter by letter the screenshot in the tutorial and have even downloaded the source and replaced my code with it. I have checked everything, and my background won’t even scroll, much less loop. does it have something to do with CS4?

 
avatar for garetjax13 garetjax13 2 posts
Flag Post

nvm. good grief. one liitle semicolan…..

 
avatar for ruudiluca ruudiluca 3366 posts
Flag Post

Maybe it just hates you.

Sign in to reply


Click Here