02-15-2011 04:56 PM
I've been trying to get the QNX ToggleSwitch to work in Flex, but I don't think it's going to. It seems I'd almost have to do a Flex component and skin it to match the QNX styles.
Has anyone else tried this in Flex?
Solved! Go to Solution.
02-15-2011 05:02 PM - edited 02-15-2011 07:51 PM
Edit: See comantis's post below for solution!
if this is like the other situations i've seen (and tested), it is most likely because the QNX Library was compiled against AS3 and not MXML. you will find that the display objects from the QNX library will not work straight out of the box with MXML. You will need to implement flex equivelents of those QNX components. here is a link to a thread with a little more detail:
hope that helps. good luck!
02-15-2011 05:12 PM
Yeah, the more I work with this, the more I realize as this app grows I'll be forced to migrate it into something a lot more native to the PlayBook, which will likely be a good idea anyways.
Thanks for the fast response JRab, I could probably skin a Flex toggle button to use similar color schemes for now, but it won't be a pretty slider.
02-15-2011 05:17 PM
no problem at all! and yah i gotta say if i had started out with burrito id probably have gone down the MXML road but since i started out with Flash Builder 4, it wasnt as easy as it is now to program for the playbook via the MXML route. So i stuck with pure AS3. now that i look back im kind of glad i chose AS3. Although the MXML structure allows for an easy development by giving easier control over your components, i love the AS3 ability to customize and make an app from scratch.
im a control freak haha i like knowing whats happening and how. i refuse to use the QNX containers for that reason lol. but to each his own - whatever works for you best and is most convenient, go with that and perfect it!
02-15-2011 05:22 PM
Knowing NOTHING about development I started with Flash Builder 4 because that's what I had. Started out in the WYSIWYG mode, got it all laid out, but now have been working more in code view, almost exclusively - and maximized view no less.
Maybe some day I'll get to be halfway decent in AS3 or even be able to start from scratch, however right now I'm at least able to walk - someday I'll run.
02-15-2011 05:25 PM
This topic was actually really good for me to read - I started with a flex example and was using mxml originally, and thankfully never ever could get design mode to work in Burrito, so I began to learn actionscript. I'm glad I did because even though I don't get to really layout my components, I feel like I'm able to see why things are happening and how I can control them (as JRab mentioned), and it really helps me as a new developer get a feel for the system.
02-15-2011 05:26 PM
your last line kind of reminds me of the quote i stole from the first iron man movie and use almost everyday when someone tells me im doing something outrageous:
"Jarvis... Sometimes you have to run before you can walk."
at first glance its utterly ridiculous but then it makes a world of sense
p.s. and yes im a HUGE iron man fan hah
02-15-2011 05:33 PM
@jrab: You should change your avatar to an iron man icon. You probably have a secret lab that you have all these machines coming up with sample code to share with everyone. So "jrab" is not a single person, it is a hord of robotic arms coding for you. It is all very clear now.
02-15-2011 05:37 PM - edited 02-15-2011 05:38 PM
darn it. i would have thought that i could have kept this charade up for a just a little while longer. but thats how the cookie crumbles!
02-15-2011 07:38 PM
Personally, I am using flex, and just using the Blackberry controls where there is no suitable flex equivalent. I am using the qnx toggle swtich in my code. Here's how you can do it:
In your mxml (wherever you want the toggle switch to appear) add
<mx:UIComponent id="toggleSwitchContainer" />
then in your initialize function (or wherver else) add:
var toggleSwitch:ToggleSwitch = new ToggleSwitch(); toggleSwitchContainer.addChild(toggleSwitch);
you can then add event listeners etc. This is working fine for me.
For now I am doing this, however eventually I want to skin the hslider to make a Flex Toggle Switch. Then I can port my flex app to other (Android) devices.