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
Developer
ahazdesigns
Posts: 152
Registered: ‎08-25-2010
My Device: 9530, 9550, 9630

VolumeSlider how to use it?

Ok, my venture for the day was to attempt to create a slider (any kind would have made me thrilled lol) but i couldnt even get as far as getting something to show up in my flex mobile application.

 

i played with this on and off throughout the classday and could not figure out how to implement any type of slider. All the documentation i was looking at has <mx:script> in it but justwhen i think im getting somewhere with it it will tell me that MX is not bound....ive looked at about 10 different websites and tried to adjust the code to make it work in my app but no luck

 

I wish there were like a tutorial site for dummies on this stuff lol, any useful links for this?

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: VolumeSlider how to use it?

hey ahaz,

 

because the qnx components were compiled against AS3 and not flex, you have to do a slight work around to get any qnx display type objects to show up in flex. below is a post htat can help you "wrap" your volume slider so you can have it show up on screen:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/ToggleSwitch-in-Flex/m-p/797365/h...

 

hope that clears up a few things. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
ahazdesigns
Posts: 152
Registered: ‎08-25-2010
My Device: 9530, 9550, 9630

Re: VolumeSlider how to use it?

Ok, so everything compiles fine (looked at that link to and tested the code with the switch which worked great, and then i tried to implement slider.....)

 

Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.

 

import qnx.ui.slider.*;
            private var slider:smileyfrustrated:lider;
            private function init():void
            {
                slider = new Slider();
                slider.minimum = 1;
                slider.maximum = 10;
                slider.width = 500;
                slider.x = 40;
                slider.y = 40;
                addChild( slider );
                sliderContainer.addChild(slider);
            }

 

Im not using a skin

Developer
ahazdesigns
Posts: 152
Registered: ‎08-25-2010
My Device: 9530, 9550, 9630

Re: VolumeSlider how to use it?

<mx:UIComponent id="sliderContainer" x="10" y="100" /> is the container

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: VolumeSlider how to use it?

hey ahaz,

 

you seem to have two lines that are using the addChild() method. get rid of the one above this line sliderContainer.addChild(slider);. the one thats by itsself. that should fix it up. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
ahazdesigns
Posts: 152
Registered: ‎08-25-2010
My Device: 9530, 9550, 9630

Re: VolumeSlider how to use it?

wow. that makes me question my intelligence lol. I had to have read those over so many times and i had even removed the sliderContainer.addChild(slider); line, now to get the the data out of the slider :smileyhappy:

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: VolumeSlider how to use it?

haha dont beat yourself up! we run into problems like this all the time. you stare at your code long enough you start to miss the small things and even start seeing things that arent there! sometimes the best thing to do is step back and come back with a fresh pair of eyes :smileyhappy:

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
ahazdesigns
Posts: 152
Registered: ‎08-25-2010
My Device: 9530, 9550, 9630

Re: VolumeSlider how to use it?

[ Edited ]

do i have to be in the sim to be able to test a volume control?

 

im getting an error:

VerifyError: Error #1014: Class qnx.pps::PPS could not be found.

 

 

whenever i try using:

 

public function onDragMove():void

{

audio = AudioManager.audioManager;

audio.setOutputLevel(volume.value);

}

 

 

 

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: VolumeSlider how to use it?

hey,

 

yes whenever you get the infamous PPS channel error, it means that it uses a native feature thats only available on the simulator. so to test it, you have to deploy it there.

 

that being said, @patrickheinzelmann created an AIR application that you can run in the background that responds to error messages like this by emulating the simulator's actions. in return you are able to test it on your desktop. it looks promising but i personally have not used the application so i cant vouche for it. here is the link to the thread:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Playbook-Device-Simulation-releas...

 

good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: VolumeSlider how to use it?

There are many services (mostly the singletons) that rely on the simulator for the PPS service (pub/sub).  This is one of them.