Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 15
Registered: ‎11-17-2010
My Device: Not Specified
Accepted Solution

Basic questions - starting again what - I dunno what I'm doing

Hello I'm finding it very hard to get started building anything for the BBPlaybook. 1 reason is because I want to make a simple game and I've not made one before but mainly because I don't know the following

 

Are there any tutorials on how to make a ui/game/any app with Flash builder?

 

All tutorials for action script games that I can find are made using flash e.g. http://pelfusion.com/tutorials/35-flash-game-development-tutorials-fla-files/ and use a fla file which flash builder doesnt seem to be able to open

 

What exactly is adobe air? and what do I have to make my app with for it to be eligable for a frre playbook (if the app is any good)

 

is there a good framework for making games for the playbook/flashbuilder etc (something like xna for c#)?

 

I really appreciate any help as I'm just going round in circles at the moment not understanding anything

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Basic questions - starting again what - I dunno what I'm doing

[ Edited ]

My first suggesting would be just to get the HelloWorld application to compile and deploy on the PB.

 

There are lots of examples and tutorials on the web to developing Flex and AIR applications.  The main difference is that Flex is an application deployed in a browser and an AIR application is the same (for the most part) deployed on the desktop.  Since the OS is a "desktop" environment (vs. a browser), it will run an AIR application in its native Flash environment.

 

There are lots of games developed in Flash/Flex/AIR.  If you've never developed a game before, then this fourm might not be the best place to get into game development.  I am certain someone might have a few good sites to discuss that.  If the game is 2D, then it can be pretty straight forward depending on your game logic.  AIR will certainly manage all movement, visual effects and sound effects that you need.  If you're going 3D, then there are some 3rd party 3D enviroments that you can look at include Away3D.

 

Hope that helps.

 

I would start browsing this forum since there are many threads discussing how to get a HelloWorld application up and running and deployment issues others had experienced.

 

Welcome aboard.

Developer
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style
My Carrier: Sprint

Re: Basic questions - starting again what - I dunno what I'm doing

I just submitted a game app to the App World Submission review process. It took me about a week to figure it all out. 

 

Start by installing the Simulator and playing with some simple examples from the web.

Here's a good starting point:

  http://manewc.com/2008/01/24/as-3-bouncing-balls-with-collision-detection-within-bounds/

 

The above example shows simple techniques for Sprite creation, animation. You can then extend it to use bitmaps.

 

Another example on how to capture mouse events is here:

http://www.streamhead.com/how-to-use-images-in-actionscript-3-with-flashdevelop-and-some-other-as3-t...

 

For designing layouts and screen elements you can refer to the QNX documentation on containers: 

http://www.blackberry.com/developers/docs/airapi/1.0.0/qnx/ui/core/Container.html#includeExamplesSum...

 

You will also find lots of tips in this forum on using touch events..etc.. 

 

Google for "Flex examples" or "Actionscript examples" and if you cannot find a specific thing u need..just post a qn on this forum... Lots of smart folks hang around so you should be able to get help

New Developer
Posts: 15
Registered: ‎11-17-2010
My Device: Not Specified

Re: Basic questions - starting again what - I dunno what I'm doing

[ Edited ]

Just have to say a big thanks for the quick and helpful responses. I haven't had a chance to look at the sites you have suggested yet but will do now. I've accepted as the answer anyway as it really seems to be a great reply. Good luck on your submission I hope we both get a lovely shiney PB out of this.

 

EDIT

 

Ok so I have had a quick play with the first sample you provided and I have tried to get it working using the helloworld code. I was unsucessfull here is what I did

 

Created a Ball and Bouncing as class and copied* in the code from the site

 

my main constructor looks like this

 

import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    
    import qnx.ui.buttons.LabelButton;
    
    [SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
    public class HelloBBPB extends Sprite
    {
        public function HelloBBPB()
        {  
            var bouncingObj = new Bouncing();
            addChild(bouncingObj);
        }
    }

 

i.e. I made a bouncing object and add child

 

Clearly I have missed out a vital step, would you be able to direct me a bit more ?

 

*when I copy code in it puts # in front of each line, whats that about?

 

EDIT 2

 

Ok now I created the project at Bouncing and copied the code for bouncing.as from the site and that worked. My question is is there a way to get it working like I tried before? As Bouncing inherits from sprite can't I just add it like you would add a button? I don't understand why it didnt work the the first code (above)

Developer
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style
My Carrier: Sprint

Re: Basic questions - starting again what - I dunno what I'm doing

In the first example, 

 

Bouncing is the main class. It uses the "Ball" object from another class.

 

The variable "ball" in the init() function is instantiated as follows:

  1. var ball:Ball = new Ball(Math.random() * 5 + 5, Math.random() * 0xffffff);  
  2.                 balls.push(ball);  
and then it is added to the view using addChild(ball)
Note that when ball gets instantiated, the constructor of the Ball class is invoked which actually draws the circle.
================
Now, are you trying to create several instances of the Bouncing class? May be you need to initialize the .x, .y elements of Bouncing class