0
votes

I followed the instructions here:

https://helpx.adobe.com/flash-builder/kb/overlay-air-sdk-flash-builder.html

I clicked File -> New -> ActionScript Project Then I called my "project StartingStarling01" and made it a Web Application. I clicked Next -> Add SWC -> browse, then located my Starling.SWC file in the Program Files in my C drive that. I had downloaded the Game SDK from my Creative Cloud account: "C:\Program Files (x86)\Adobe Gaming SDK 1.4\Frameworks\Starling\Starling-Framework\starling\bin" I clicked Finish.

I created these classes:

import flash.display.Sprite;
import starling.core.Starling;

[SWF(width="400", height="300", frameRate="60", backgroundColor="#ffffff")]
public class StartingStarling01 extends Sprite
{
   private var _starling:Starling;

   public function StartingStarling01()
   {
   _starling = new Starling(Game, stage);
   _starling.start();
   }
}

import starling.display.Sprite;
import starling.text.TextField;

public class Game extends Sprite
{
   public function Game()
   {
   var textField:TextField = new TextField(400, 300, "Welcome to Starling!");
   addChild(textField);
   }
}

But I get all these problems:

enter image description here

What have I done wrong and how do I fix it please?

1
Are those classes in valid packages in the correct directory (usually src)?Marty
Yes, they are both in the default package. And this works with another version with the exact same code, only using the desktop air at the setup instead of the web.Wadzanai Mufunde
Does no one have any suggestions? Surely there must be some Starling web developers who has some idea how to get the web application feature working?Wadzanai Mufunde

1 Answers

0
votes

edit : upgraded from comments to better show code.

Are you combining multiple classes into one document? Good luck with that if you're not an expert.

I would make a Game.as with relevant imports & functions and then in StartingStarling01.as you could just import Game; and later instance it by private var _game : Game = new Game(); now you can try code as _starling = new Starling( _game, stage);
That should solve first error, Game was unknown because you did not import it, also did not instance it so how could any code in StartingStarling01.as know what you mean by Game really?

To debug, start at the bottom of error listings and work upwards (some errors are triggered by previous error below it so fix that and it solves the next above it). Anyways It seems your code cant find Starling. If not SWC then just copy a folder of Starling AS (class) files so import gets it.

An example code setup...

StartingStarling01.as

import flash.display.Sprite;
import starling.core.Starling;

import Game; //loads code of Game.as

[SWF(width="400", height="300", frameRate="60", backgroundColor="#ffffff")]
public class StartingStarling01 extends Sprite
{
   private var _starling:Starling;
   private var _game : Game = new Game();

   public function StartingStarling01()
   {
   _starling = new Starling(Game, stage);
   _starling.start();
   }
}

Game.as

import starling.display.Sprite;
import starling.text.TextField;

public class Game extends Sprite
{
   public function Game()
   {
   var textField:TextField = new TextField(400, 300, "Welcome to Starling!");
   addChild(textField);
   }
}

Also make sure you import any other needed Starling classes for example

import starling.core.Starling; //not everything covered by this
import starling.display.*; //example for handling display objects
import starling.events.*; //example for handlings events by mouse or timer etc