…I was the last week. With the damn text field. But now I have a solution and it is so simple. It is always simple. If you want your Playbook app to have a text field in which the user can write text as much as he can think of:
Just use the flash.text.TextField.
It doesn’t look as good and native as the TextArea from the community library but you can apply TextFormats. And that is important! So your code can look like:
var text:TextField = new TextField();
text.type = TextFieldType.INPUT;
text.x = 100;
text.y = 100;
text.width = 500;
text.height = 500;
and there it is your frigging TextField! If your application has a dark background you should give your TextField a background and a color for it:
text.background = true;
text.backgroundColor = 0xFFFFFF;
or get your font a nice color…
…and why becomes a pure free time project so possessive?
I program since I’ve been 14 I think. Back then I wrote some BASIC code on a old PC from a buyback center. It was fun and I read so much books about how to catch all keyboard combinations to restart the computer.
Later I learned Java and it was not fun at all. That language is giving me nothing but headache. I’ve never seen a good looking java program you want to use. But the community is nice, not like the C++ community: You have a problem? Here is a ‘Hello World’ example perhaps you understand that or you can learn LOGO….
I ended with Objective-C on the Mac and iOS platform. The documentation is getting worse (I think Apple should hire more people) but you can write good looking code and beautiful programs. It is not perfect but it is good enough. Meanwhile I learned Python but to be honest: I like brackets, they are useful to keep code readable. But for really small task it is not bad…
Finally to get to the point: I am not a total beginner but coding for the Playbook is challenging for me. ActionScript is not a big problem but every time I design the user interface the incomplete documentation and API gets in my way. Ok, I am a little bit petted, because I worked in the last time only with frameworks that are often used and so you can find a lot of solutions for problems in the web but come on…
The whole ‘I write an app for the Playbook’ should only be a free time project but I can’t get it out of my head. I should do other things but today I wrote 4 hours code for it.
Damn first world problems….
I have to admit that all not everything runs fine with FlashDevelop. The script I linked to in the last post doesn’t run well. It is able to start the Simulator but it is not able to run my code. So I googled for solutions and I discovered the Blackberry Graphical Aid (BGA) and some tutorials for the first Playbook app with FlashDevelop. Take a look here and read the whole site: http://www.studiochris.us/2010/flashdevelop-and-blackberry-playbook-development-the-basics/ (yes, it is the same adress you got the template from)
Here are some solutions for troubles I had:
- If you get an error while packing with the BGA you have probably the wrong version of AIR in your -app.xml.
- You have to set the .as file the templated created for you as a ‘Document File’ so right click on the file in the project view and you will see the rest.
It is not a mistake, it is only a happy little bug….
Ok, last time (and the first time) I wrote that I want to start with programming for the playbook. It won’t be something serious but in the end there should be a program I can be proud of and other people want to use it.
For my idea I need a textfield. To be more precise: I need a multiline textfield and users should be able to enter and edit text. And here is the problem: There is no native multiline textfield for the AIR API, there is no multiline textfield for the native sdk and with WebWorks you have a textfield but it is not really native. So when you want to write a AIR application for the playbook you can use the original AIR textfield (then you have to hack around it so the user gets the keyboard) or you have to use a extern community library.
So my question is what is this RIM? Do you want to get some developer for your device?? If so, where is the support? Oh man, I hope they get the right directions in the future, till then I have to use the community library…. and I hope the next time I can write about my progress and don’t have to rant.