Author Topic: TUTORIAL: Compiling and running the 'mode' demo in FlashDevelop  (Read 53535 times)

Cagey

  • Guest
NOTE: This tutorial does not explain how to learn or use Actionscript, or even what Flixel is!  If you want to know more about these things or other topics, please check out the general help thread.  Thanks!


1. Open up FlashDevelop and create a new AS3 Project


2. Unzip the flixel file in to the src directory in your new project folder


3. Delete Main.as, then right-click Mode.as and click Always Compile


4. Click Test Movie and see the awesome come to life!
« Last Edit: Fri, Jul 24, 2009 by Adam Atomic »

owen

  • Guest
Hello,

I'm interested in trying the library out but I'm having trouble compiling Mode.  I'm using FlashDevelop on my Macbook using Parallels so that might have something to do with it, but when I compile the project I get this error:

MenuState.as line 24
1020: Method marked override must override another method.

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Sounds like it's having trouble finding the FlxState base class, but not sure why...could be the way paths work in parallels?  No idea yet

owen

  • Guest
It looks like it's being imported correctly in FD.

The classpath for the project is /src containing Mode.as and the com & data folders.
I can auto-complete FlxState so I'm assuming it got imported correctly...

Cagey

  • Guest
Uh I think that's a bug/difference in one of the Flex Builder versions and in the Mode demo. If you remove override from that line it should work. For some reason most versions of Flex Builder seem to be compiling that, so maybe yours is outdated? Worth updating anyway i guess.
« Last Edit: Fri, Jun 5, 2009 by Cagey »

Malakuko

  • Guest
Hey, i keep getting the same problem every time i try to do this, when i hit test movie I get this, http://i164.photobucket.com/albums/u31/malakuko/Error-with-fixel.jpg , Im guessing it should just play? but it asks me to configure the compiler which i have no idea how to do or what it means coz im a total noob at programming and all that. I started working on a game a few weeks ago, its a beat em up, like street fighter, and ive been doin research into programming n all that so when i saw what tom fulp said today on newgrounds about fixel i thought this might be the medium im after since 1: i wanted to make the game all pixelated anyway and 2: im crap at programming, so yeah, help and tutorials would be appreciated :)

ben

  • Guest
Malakuko,

Did you download Flex AS3 from Adobe Open Source website?
http://opensource.adobe.com/wiki/display/flexsdk/download?build=3.4.0.6955&pkgtype=1 is working for me.
Also you'll need standalone (debug) players. I've got Flash CS3, so I've the one that came with it.
This page should be helpful to basic configuration of FlashDevelop: http://www.flashdevelop.org/wikidocs/index.php?title=Getting_Started

After you've extracted the Adobe Flex SDK somewhere, click Yes in that dialogue box that keeps coming up for you, and then at left, all I had to do was select AS3Context, then scroll down on the right to "Language" and then tell it where to find the Flex SDK:


Then just follow Cagey's instructions in this thread and it should work... it did for me, anyway....

owen

  • Guest
Ok cool, removing the override actually allowed the program to compile correctly but then there where lots of errors while it was attempting to run.  However downloading the new Flex SDK allowed it to compile fine.

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Awesome!  I will have to add somewhere links to the Flex SDK I think, I wasn't aware that it wasn't really included with FlashDevelop (i.e. I did not even think about it :P )

JakeDrake

  • Guest
I've been searching everywhere in order to get to a solution to this on my own but since it is a pretty generic error and I see that other people have had it I'll ask it here.  When following the directions to the T and attempting to compile Mode I get this build log in FlashDevelop:


Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Documents and Settings\Jacob\My Documents\Flixl Projects\New Project2\New Project2.as3proj" -ipc f4628293-a3ee-45ea-8def-ae993ded0cc7 -compiler "C:\FLEX SDK 3.4" -library "C:\Program Files\FlashDevelop\Library" -cp "C:\Documents and Settings\Jacob\My Documents\Flixl Projects\New Project2\src"
Using the Flex Compiler Shell.
Building New Project2
mxmlc -load-config+=obj\NewProject2Config.xml -debug=true -incremental=true -benchmark=false -o obj\NewProject2633800578733125000
Starting new compile.
C:\Documents and Settings\Jacob\My Documents\Flixl Projects\New Project2\src\Mode\Mode.as:
Error: A file found in a source-path must have the same package structure 'Mode', as the definition's package, ''.
Build halted with errors (fcsh).
Loading configuration file C:\FLEX SDK 3.4\frameworks\flex-config.xml
Loading configuration file C:\Documents and Settings\Jacob\My Documents\Flixl Projects\New Project2\obj\NewProject2Config.xml
(fcsh)
Done (1)


I think it has to do with a name or a structure somewhere but I still can't figure it out.  I tried to change the flixel 1.0 to "Mode" as well.  Thanks in advance for any help and thanks AA for your obvious hard work in putting flixel together!

xMCNUGGETx

  • Guest
C:\Documents and Settings\Jacob\My Documents\Flixl Projects\New Project2\src\Mode\Mode.as:
Error: A file found in a source-path must have the same package structure 'Mode', as the definition's package, ''.

You have the Mode.as in a subfolder of src called Mode.  Check the 1st post and Mode.as is directly in the src directory it shouldn't be in this sub folder.

JakeDrake

  • Guest
Ok got it!  Mode finally compiled and ran just fine.

I followed the above instructions a little too closely apparently because all I did was to unzip the whole flixel zip into the src folder but what is apparently really intended is for you to unzip only the subfolder that contains the operating system you intend to use.  Maybe this should be put a little more clearly.

Thanks for you help!

tonyoakden

  • Guest
I followed the Cagey's instructions and the demo runs fine for me.  The only issue I had was not knowing I had to set the path for Flex3 and trying instead to set the path for Flash (as per the instructions in FlashDevelop).  All I need to do now is learn how to code in Action script and I'll be good to go.

Thanks for the instructions Cagey and thanks to Adam for the great code!

regards,

Tony Oakden
http://www.charliedoggames.com

rinkuhero

  • Guest
i don't see a 'src' folder. do i have to create one?

i get these errors when i try to follow this guide:

C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(13): col: 4: Error: unable to resolve '../../../data/cursor.png' for transcoding
[Embed(source="../../../data/cursor.png")] private var ImgCursor:Class;
^
C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(13): col: 4: Error: Unable to transcode ../../../data/cursor.png.
^
C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(15): col: 4: Error: unable to resolve '../../../data/menu_hit_2.mp3' for transcoding
[Embed(source="../../../data/menu_hit_2.mp3")] private var SndHit2:Class;
^
C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(15): col: 4: Error: Unable to transcode ../../../data/menu_hit_2.mp3.
^
C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(14): col: 4: Error: unable to resolve '../../../data/menu_hit.mp3' for transcoding
[Embed(source="../../../data/menu_hit.mp3")] private var SndHit:Class;
^
C:\Users\Administrator\Desktop\Rainshine\com\adamatomic\Mode\MenuState.as(14): col: 4: Error: Unable to transcode ../../../data/menu_hit.mp3.
^
Build halted with errors (fcsh).
Done (1)

rinkuhero

  • Guest
nevermind, i created a new project instead of creating a new document, and it seems to work

scattle

  • Guest
I'm pretty new here, but, I've read everyones' posts on this thread, and I did everything in the tutorial, but every time I use Test Movie, I get this at the bottom:

C:\Documents and Settings\HP_Owner\My Documents\Flixel4\src\Mode.as(8): col: 28 Error: The definition of base class FlxGame was not found.
public class Mode extends FlxGame
^
Build halted with errors (fcsh).
Done (1)

hanuman

  • Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
    • Physics Games
Hi everyb! ;D

I've started out with flixel and FlashDevelop and everyths works out, but I've got a question. I'm using FlashDevelop + FlashCS4, in FlashIDE I'm drawing assets, exporting for AS, compiling swc, then use it in FD. But when I try to do it with flixel:

this.add( new FlxBlock(0, 0, 550, 450, MenuBackgroundDesign, 0 )); // MenuBackgroundDesign - asset class name in .swc

It throes me error #1009, though with [Embed] tag, everyths works fine. Please, explain it to noob... 8)

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Are you able to create a FlxSprite using the same name?  It's expecting a class name that represents an embedded image

hanuman

  • Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
    • Physics Games
Are you able to create a FlxSprite using the same name?  It's expecting a class name that represents an embedded image

Hi Adam, Thanx for reply.
No. This code throws error #1009:

this.add( new FlxSprite(MenuBackgroundDesign) );

This works fine:

this.addChild( new MenuBackgroundDesign() );

i.e. standart graphics exporing form FlashIDE to FlashDevelop doesn't work... ???

UPDATED: Heh, I understood, that flixel only works with BitmapData-type graphic classes, but refuses to work with DisplayObject-type classes... Does it mean I can't draw graphics in FlashIDE for flixel?
« Last Edit: Sat, Jul 18, 2009 by hanuman »

Alexitrón

  • Guest
WOOOOOOOOOOOOOOOOO ! ;D I finally got that mode.ass thing to work . Nice little game by the way . So , yeah , I guess i have to read some tutorials now .