Under rating threshold (hideshow)
i have this error as well Symbol=Background, layer=Layer 1, frame=1, Line 1 The class or interface 'Background' could not be loaded. i wonder if its becos my background file is jpeg.if so how do i change it to png? thanks
Under rating threshold (hideshow)
i have this error as well Symbol=Background, layer=Layer 1, frame=1, Line 1 The class or interface 'Background' could not be loaded. i wonder if its becos my background file is jpeg.if so how do i change it to png? thanks
Under rating threshold (hideshow)
Myself I did something simple - instead of adding extra graphic into the already created background i just made a change in "if" function so it moves to "_x = 600" instead of "_x = 0" - still looped, however with a white break, but the city appears in normal way.
Under rating threshold (hideshow)
my background and ship are moving together! but when i hide the ship layer the background is there, and when the background layer is hidden the ship is there! so why do they move together!
Under rating threshold (hideshow)
heeey all I have a cool code that definately works:
class Background extends MovieClip
{
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) ) { _x = _x - 3; } if( Key.isDown(Key.LEFT) ) { _x = _x + 1; } _x = _x - 2;
_x -= 1;
if(_x < -2110)
{
_x = 0;
}
}
}
after that just double click the background in the libary then copy the background paste it twice
then paste them left from each other so you have 3 times the background without gaps!
after that just save it and test it!
enjoy!
(if this worked please press the +)
Under rating threshold (hideshow)
AWESOME!!!! finally got my background scrolling by changing all of its names to bg1 and saving as a .PNG file to start with!! now for Shootorial #3 5/5
Under rating threshold (hideshow)
@regerity:
you siad you solved the error message by making the background a .png file... how do you do that?? (bit of a noob at all this coding stuff...)
Under rating threshold (hideshow)
I noticed that there was a about a millisecond gap from the end of the background before it popped back in to repeat, meaning their would be a small jump. If you want it to really run seamlessly simply change the code to - _x -= 5;
if(_x < -2110)
{
_x = -10;
}
Under rating threshold (hideshow)
Very Ultra Mega Very Very Ultra Mega Very Ultra Mega Very Ultra Mega Very Ultra Mega and SUPER COOL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Under rating threshold (hideshow)
Ok im really confused. I have a decent understanding of the codes, but in if(_x < -2210. So 2110 is th width of the BG. Mine is custom made and I made the width of the custom 2110 as well. I have all the codes down correctly. But when I play it, the BG only loops once. What am I doing wrong.
My full BG code is:
----------------------------------------------------------------------------
class Background extends MovieClip
{
function onEnterFrame()
{
_x -= 1;
if(_x < -2110)
{
_x = 0;
}
}
}
--------------------------------------------------------------------------
Help anyone???
Under rating threshold (hideshow)
I created my own background image and I have no clue how long it is... if someone could message me on a way to find out it would be greatly appreciated. I am using CS5. I used to know how to find it in CS3....
Under rating threshold (hideshow)
I can't download the source files, is there any other way to get them? Other than that this is a great tutorial as far as I've seen.
Under rating threshold (hideshow)
Could anyone explain why using "class Background extends MovieClip { function onEnterFrame() { _x -= 7; if(_x < -2110) { _x = 2100; } } } " instead of the code provided in the tutorial actually makes it loop seamlessly? Where does that 2100 come from?
Under rating threshold (hideshow)
@bhattarai333 I know how to fix your problems, First, the Background.as file must be where your .fla file and Ship.as file are! Second, your background code should be:
class Background extends MovieClip
{
function onEnterFrame()
{
_x -= 1;
if(_x < -2110)
{
_x = 0;
}
}
}
the "Statement block must be terminated by '}'" error comes because you didnt put a '}' at the end of the code. and the "The class 'Background' needs to be defined in a file whose relative path is 'Background.as'" message comes because the Background.as isn't in the same place as the .fla file or in the code you put ackground instead of Background!
AND you get the "The class or interface 'Backround' could not be loaded." error because in the Background Movie Clip Properties, you put the Linkage Identifier: Backround and the Class: Backround instead of Background.
There you go!
Under rating threshold (hideshow)
The only thing I would change is to not name everything the same. The layer is named ship, the class is named ship, the identifier is ship... it would be useful to change it up to make it clearer WHICH ship object you're referring to when you say ship. Say, call the layer 'shipLayer'
Under rating threshold (hideshow)
I am having trouble with this. My background image isn't scrolling correctly. I c/p it so it would loop seamlessly, but only the second instance resets and continues to scroll. Any ideas why the first image isn't repeating?
Under rating threshold (hideshow)
Took me like 15 minutes to figure out he spelled "back"g"round" with a "g" i didn't use a g, other than that the tutorial works perfectly
Under rating threshold (hideshow)
if(_x < -2110) { _x = 600; } repositions the background just off screen for a smooth looping effect instead of having it pop into being at 0 offset, but hooray these tutorials are great so far, thanks. =D
Under rating threshold (hideshow)
If you want the background to loop properly, here is the code.
class Background extends MovieClip { function onEnterFrame() { _x -= 7; if(_x < -2110) { _x = 2100; } } }
The tutorial only makes it loop once.
Under rating threshold (hideshow)
here is a way I found for the code to make it even better, the background will go faster if you go foreward, and will go slower if you go backward
class Background extends MovieClip
{
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) )
{
_x = _x - 3;
}
if( Key.isDown(Key.LEFT) )
{
_x = _x + 1;
}
_x = _x - 2;
}
}
by the way this is not including the loop code
Under rating threshold (hideshow)
I have the same problem as lareeh. Does anyone know why it keeps saying "symbol=Background, layer = layer1,frame=1,line 1 The class or interface 'Backround' could not be loaded"?
Under rating threshold (hideshow)
Would have been nice if they had sections for vertical shooters... To get it to scroll vertically, use _y += (input #) and for the loop, use (_y > (input #). Hope that clears things up!
Under rating threshold (hideshow)
No matter what I do I can't get the backround to scroll, I keep getting this message:
The class 'Background' needs to be defined in a file whose relative path is 'Background.as'.
and:
Statement block must be terminated by '}'
and:Syntax error.
I have my backround code like this:
class ackground extends MovieClip
{
function onEnterFrame()
{
_x -= 1;
if(_x < -2110)
{
_x = 0;
}
}
Could some one help?
Under rating threshold (hideshow)
It works every time however we are making trivial mistakes... Once you make it work by problem solving. If you cannot do that then go learn programming logic and come back.
However, I will admit the tutorials are unclear, they make you learn flash by problem solving.