Author Topic: Noob Question  (Read 2497 times)

emre

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Noob Question
« on: Mon, Jul 25, 2011 »
Hi, this is my first post, and if I can understand what's wrong with my code this won't be my last post I hope :P

I'm just doing what the tutorial says. I don't know which one, but they're all the same for beginners. So, no need to talk much. Here's what I do (actually copy/paste):

1) I open FlashDevelop and make a new project named as HelloWorld
2) I make 2 new classes into the src folder (HelloWorld and PlayState)
3) Then I copy/paste these codes into them:

HelloWorld.as
Code: [Select]
package
{
import org.flixel.*; //Allows you to refer to flixel objects in your code
[SWF(width="640", height="480", backgroundColor="#000000")] //Set the size and color of the Flash file

public class HelloWorld extends FlxGame
{
public function HelloWorld()
{
super(640,480,PlayState); //Create a new FlxGame object and load "PlayState"
}
}
}

PlayState.as
Code: [Select]
package
{
import org.flixel.*;

public class PlayState extends FlxState
{
override public function create():void
{
add(new FlxText(0,0,100,"Hello, World!")); //adds a 100x20 text field at position 0,0 (upper left)
}
}
}

Then I make the HelloWorld.as as the main file to be compiled. Also, I right-click to my HelloWorld(AS3) project from the Project Window and click Properties, then I pass into the Classpaths tab, and add my flixel folder under "src" entry. It looks like this:

src
..\..\..\..\..\flixel

(Note that my flixel folder is located under C:\)

Then, when I hit F5, it gives errors. Let me write them for you:

Code: [Select]
C:\flixel\org\flixel\FlxGame.as(33): col: 4: Error: transcoding parameter 'embedAsCFF' is not supported by 'flex2.compiler.media.FontTranscoder'

C:\flixel\org\flixel\FlxGame.as(33): col: 4: Error: Unable to transcode data/nokiafc22.ttf.

There's a problem with my FlxGame.as file, but I downloaded from github where the project is located at. I hope someone will fix my problem.

Thank you very much.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Noob Question
« Reply #1 on: Mon, Jul 25, 2011 »
You're compiling with an old version of the Flex SDK. I'd suggest upgrading to a newer one. 4.5.1 would make sense, but any recent stable release will do.

http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

emre

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Noob Question
« Reply #2 on: Mon, Jul 25, 2011 »
Which one of these do i have to download?
http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5
Thanks again.

emre

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Noob Question
« Reply #3 on: Tue, Jul 26, 2011 »
Now, I have this problem:

C:\flexsdk\frameworks\flex-config.xml(56): Error: unable to open 'libs/player/10.0/playerglobal.swc'

Weird...

Wing Eraser

  • Guest
Re: Noob Question
« Reply #4 on: Thu, Jul 28, 2011 »

newp

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Noob Question
« Reply #5 on: Mon, Sep 19, 2011 »
I have been getting the same error as the OP. However, I have the newest FlexSDK installed.

I have:

FlashDevelop 4 beta 3
flex_sdk_4.5.1.21328

I have tried uninstalling, reinstalling, different versions, commenting out various lines in FlxGame.as. I keep getting:

Quote
C:\Users\Derp\Desktop\pixelate\pixelate-flixel_primer-096a23b\src\org\flixel\FlxGame.as(34): col: 3: Error: unable to build font 'system'

C:\Users\D#\Desktop\pixelate\pixelate-flixel_primer-096a23b\src\org\flixel\FlxGame.as(34): col: 3: Error: Unable to transcode data/nokiafc22.ttf.


Here's part of FlxGame.as:

Code: [Select]
public class FlxGame extends Sprite
{
// NOTE: Flex 4 introduces DefineFont4, which is used by default and does not work in native text fields.
// Use the embedAsCFF="false" param to switch back to DefineFont4. In earlier Flex 4 SDKs this was cff="false".
// So if you are using the Flex 3.x SDK compiler, switch the embed statment below to expose the correct version.

//Flex v4.x SDK only (see note above):
[Embed(source="data/nokiafc22.ttf",fontFamily="system",embedAsCFF="false")] protected var junk:String;

//Flex v3.x SDK only (see note above):
//[Embed(source="data/nokiafc22.ttf",fontFamily="system")] protected var junk:String;