01-21-2013 10:03 PM
I spend days trying to make super simple app with one bitmap on screen.
image.png
nothing works ;(
I tried this:
don't work. It says "Call to a possibly undefined method Image."
Can someone give/refer to super simple code example which works?
Im using Flash Builder 4.7
P.S.I made app with Flash Pro it was easy but seems this Flash Builder needs degree in rocket science
any help appreciated! Thanks
Solved! Go to Solution.
01-21-2013 11:57 PM
01-22-2013 05:43 AM
Sounds more like you haven't installed the SDK correctly, or the import is missing
01-22-2013 07:53 AM
01-22-2013 09:13 AM - edited 01-22-2013 09:43 AM
yes! one breakthrough -
after i did "Add platform specific libraries to library path" things changed - no more erorr in code, but..
still doesnt work...
thats what i am doing:
1. Create new Actionscript Mobile Project. Name it 'kkk'
2. in project properties i click "Add platform specific libraries to library path"
3. in 'src' folder i import icon.png file
4. write the code:
package
{
import flash.display.Sprite;
import qnx.ui.display.Image;
import qnx.fuse.ui.display.Image;
[SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
public class kkk extends Sprite
{
private var image:Image;
public function kkk()
{
super();
image = new Image();
image.setImage("image.png");
image.setPosition(10,10);
addChild(image);
}
}
}now code is OK, no errors .but-
5. I run the code i get error:
An ActionScript error has ocured:
ReferenceError: Error #1065: Variable qnx.fuse.ui.styles::CoreStyles is not defined.
at qnx.fuse.ui.theme::ThemeWhite/createCSS()
at qnx.fuse.ui.theme::ThemeWhite()
at qnx.fuse.ui.theme::ThemeGlobals$/getTheme()
at qnx.fuse.ui.theme::ThemeGlobals$/http://www.qnx.com/2009/qnx/internal::getCSS()
at qnx.fuse.ui.core::UIComponent/get css()
at qnx.fuse.ui.core::UIComponent/init()
at qnx.fuse.ui.display::Image/init()
at qnx.fuse.ui.core::UIComponent()
at qnx.fuse.ui.display::Image()
at kkk()[C:\Documents and Settings\mmm\grybasssssssssss\kkk\src\kkk.as:17]
How to sort this out? thanks!
BTW- my way of importing .png is : right mouse buton -->import --> general -> File System
01-22-2013 09:49 AM
01-22-2013 09:56 AM - edited 01-22-2013 09:57 AM
Seems like there's still something wrong with the SDK.Since you are using Flash Builder 4.7, I think there was a different approach for installing the SDK
If you want to go for pure AS3, try this
(your image should be in a subfolder called 'assets')
package
{
import flash.display.Bitmap;
import flash.display.Sprite;
[SWF(width="1024", height="600", backgroundColor="#404040", frameRate="60")]
public class Test extends Sprite
{
[Embed(source='assets/image.png')] public static const MyImage : Class;
public function Test()
{
initBGR();
}
private function initBGR():void
{
var myImg:Bitmap = new MyImage();
var mySprite:Sprite = new Sprite();
mySprite.addChild(myImg);
mySprite.cacheAsBitmap = true;
addChild(mySprite);
}
}
}
(not sure if 'static' has to be there)
01-22-2013 10:00 AM
Follow above link to add ANE.
01-22-2013 10:09 AM
whait a bit. I dont understand
you say i must include ANE. Which is native specific features of bb10 device. Does this mean this code will not work for other devises like android(or any other which supports AIR)?
is there a method to load an image without ANE?
i thought ANE is for something really specific - like acelerometer or like. but to load one inocent bitmap - do i really need ane?
also you sayed "load them dynamically" - how this is done?
in Flash Pro. I have library where i store items how this is achieved in "flash builder"?
I really thought these simple things gonna be sraightforward.
Im moving from Flash Pro so , Flash Builder is new to me
Sorry for my ignorance. thanks for help.
01-22-2013 10:16 AM