FinalArmageddon
12 posts
|
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
I redid everything, and put all the old files in the trash. It’s working now, but I have a slight problem with the background. My code currently is:
class Background extends MovieClip
{
function onEnterFrame()
{
x -= 2;
if(x < -600)
{
_x = 0;
}
}
}
My background is 600 pixels wide. I laid another one beside it to hide the seam, but instead of looping once it has gone through 600 pixels, it goes the full near 1200, and then waits for the image to be at the back of the screen (near 1800 pixels total)
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
I decided to just remake everything. I have no errors, syntax says all code is correct, but when I went to test the seam on the background, (Control > Test Movie) neither my ship nor background moved. Is there something else I need to do?
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
This is probably more info than you need but it it a:
Mac OS X version 10.5.6
2.4 GHz Intel Core 2 Duo Processor
2 GB 667 MHz DDR2 SDRAM Memory
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
I edited all the names (of files, classes, etc.) and made the 1st letter capitalized, no difference. the class or interface ‘Ship’ could not be loaded.
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
original image: ship2.jpg
script filename: ship.as
movie clip name: ship
identifier: ship
class: ship.as
text under linkage: Export: ship
error: The class or interface ‘ship.as’ could not be located.
When Identifier And Class Are Switched
error: The class ‘Ship’ needs to be defined in a file whose relative path is ‘Ship.as’
I did not capitalize them when I typed them, but for some reason they are capitalized in the error.
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
flash cs4.
the background is stationary too, I think it has something to do with my linkage. under linkage, I have ‘ship.as’ and ‘background.as’ whenever I export it has the same 2 errors I posted at the very 1st post. What exactly do you have under the linkage when you make games?
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
well, I looked over it and I even made a completely new one starting with shootorial #0 and it still won’t move. no errors, and here’s the code:
class Ship extends MovieClip
{
var velocity;
function onLoad()
{
velocity = 10;
}
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) )
{
_x = _x + velocity;
}
if( Key.isDown(Key.LEFT) )
{
_x = _x – velocity;
}
if( Key.isDown(Key.UP) )
{
_y = _y – velocity;
}
if( Key.isDown(Key.DOWN) )
{
_y = _y + velocity;
}
}
}
other info:
name: ship
linkage: ship2.as (If I change it to ‘Export: ship2.as’ it will say “the class or interface ‘ship’ could not be loaded”)
when I check syntax it says: the class ‘Ship’ needs to be defined in a file whose relative path is ‘Ship.as’
If I turn on export and add the class ‘Ship’ I get the 2 errors I started with, along with the error I was trying to fix.
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
That’s done and it published w/o error, but when I Control > Test Movie it is stationary when I press the arrow keys. Is it supposed to move yet?
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
Ok, I edited the linkage to say ship1.as but the “Classes may only be defined in external ActionScript 2.0 scripts.” remains. What should I do about that?
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
Sorry for my ignorance, but how exactly would I go about making an external Actionscript Script? I just did File > New > ActionScript File, like it showed in the Shootorial. And I am using an Actionscript 2.0 Flash File.
|
|
|
FinalArmageddon
12 posts
|
Topic: Game Programming /
Need help with ActionScript
I followed the first 2 shootorials exactly, but I keep getting these 2 errors:
“Classes may only be defined in external ActionScript 2.0 scripts.”
Location: Symbol=Ship1, layer=Layer1, frame=1, Line 1
Source: Class Ship1 extends MovieClip
“The class or interface ‘Ship1’ could not be loaded.”
Location: Symbol=Ship1, layer=Layer1, frame=1, Line 29
Source: }
Please help!
|