hb2007
39 posts
|
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?
|
|
|
MoonlaughMaster
6168 posts
|
screenshot, perchance? Your code? More info?
Then I can help you.
|
|
|
hb2007
39 posts
|
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;
}
}
}
|
|
|
t2t2
22 posts
|
(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.
|
|
|
hb2007
39 posts
|
|
|
|
hb2007
39 posts
|
 By hb2007 at 2008-10-19
|
|
|
t2t2
22 posts
|
You still haven’t told what the problem is through, Is it jumping at wrong place or something?
|
|
|
kloma
3 posts
|
|
|
|
kloma
3 posts
|
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.
|
|
|
hb2007
39 posts
|
You are right kloma my background doesnt loop, I tried your suggestion but it still didnt work!
|
|
|
rudolf13
1 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
|
|
|
hb2007
39 posts
|
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?
|
|
|
Jspapp
1 post
|
Is the background moving but not looping?
If its that, then you need to make a background that loops seamlessly into itself.
|
|
|
t2t2
22 posts
|
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?
|
|
|
chaos548
31 posts
|
i also have this problem…
on the 3rd loop it turns to white…
|
|
|
hb2007
39 posts
|
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!
|
|
|
hb2007
39 posts
|
hey jsapp my backround is moving and not looping, make a background that loops seamlessly into itself.
how?
|
|
|
mldnlght
2 posts
|
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 =\
|
|
|
Grape
48 posts
|
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.
|
|
|
hb2007
39 posts
|
thanks a lot Grape finally i knew the solution, you really helped.
|
|
|
garetjax13
3 posts
|
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?
|
|
|
garetjax13
3 posts
|
nvm. good grief. one liitle semicolan…..
|
|
|
Ruudiluca
8858 posts
|
|