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
Contributor
dukebigalow
Posts: 18
Registered: ‎03-17-2012
My Device: playbook
My Carrier: mobitel
Accepted Solution

qnx.ui.listClasses.DropDown strange TypeError

Hello.
I need some help, because I came across an error, that I can't make any sense of.
On the  1.1.1 SDK my project runs just fine. But I recently updated the SDK to 2.0 and there was the error.
This is the stacktrace:

TypeError: Error #1034: Type Coercion failed: cannot convert caurina.transitions::TweenListObj@2ceb2041 to caurina.transitions.TweenListObj.
	at caurina.transitions::Tweener$/addTween()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxui\src\caurina\transitions\Tweener.as:215]
	at qnx.ui.listClasses::List/showShadows()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\listClasses\List.as:2594]
	at qnx.ui.listClasses::List/draw()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\listClasses\List.as:1595]
	at qnx.ui.core::UIComponent/drawNow()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\core\UIComponent.as:335]
	at qnx.ui.listClasses::DropDown/updateAllData()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\listClasses\DropDown.as:1019]
	at qnx.ui.listClasses::DropDown/draw()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\listClasses\DropDown.as:750]
	at qnx.ui.core::UIComponent/fireCallLaterMethods()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\core\UIComponent.as:304]
	at qnx.ui.core::UIComponent/callLaterHandler()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\core\UIComponent.as:296]
	at flash.utils::Timer/_timerDispatch()
	at flash.utils::Timer/tick()

 

The DropDown show up, but is empty and disabled.
So if anyone could help me, I would appreciate it.
Thanx! 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: qnx.ui.listClasses.DropDown strange TypeError

Can you post some code?
Please use plain text.
Contributor
dukebigalow
Posts: 18
Registered: ‎03-17-2012
My Device: playbook
My Carrier: mobitel

Re: qnx.ui.listClasses.DropDown strange TypeError

My code is nothing unusual:

declaration:

<listClasses:DropDown id="countDrop" width="304" height="45" rowCount="4" click="hideKey(event)" select="checkCountry(event)"/>

component for placement

<mx:UIComponent id="countcont" y="302" right="99" width="302" height="45"/>

 on view creationComplete:

protected function initState():void
{
	var tmp:Array = Countries.getCountries();

	countDrop.dataProvider = new DataProvider(tmp);
	//logged user		
	user = Shared.getInstance().userinfo;
	if(user != null)
	{
		
	tmp.forEach(select);
		//select the right country	
	function select(elem:*, index:int, arr:Array):void{
	if (elem.code == user.user.country)
		countDrop.selectedIndex = index;
	}
			
}	
	//add the DropDown to component
	countcont.addChild(countDrop);
				
}

 

The code runs normal and the error is thrown later

 

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: qnx.ui.listClasses.DropDown strange TypeError

If you bypassed your code to just put something simple into the data provider, does it show then?

Like:

countDrop.dataProvider = new DataProvider( [ { data:'a', label: 'A'}, {data:'b', label: 'B'}]);

This would isolate if it has to do with the data contents or trying to use the component in MXML.
Please use plain text.
Contributor
dukebigalow
Posts: 18
Registered: ‎03-17-2012
My Device: playbook
My Carrier: mobitel

Re: qnx.ui.listClasses.DropDown strange TypeError

Done it and nothing has changed.
How else can I add the component to the view?


Now I have the same problem with the ToggleSwitch. I just put it on the view and when I toggle it, that error is thrown:

TypeError: Error #1034: Type Coercion failed: cannot convert caurina.transitions::TweenListObj@7fa99041 to caurina.transitions.TweenListObj.
	at caurina.transitions::Tweener$/addTween()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxui\src\caurina\transitions\Tweener.as:215]
	at qnx.ui.buttons::ToggleSwitch/animateThumbTo()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\buttons\ToggleSwitch.as:563]
	at qnx.ui.buttons::ToggleSwitch/handleThumbUp()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\buttons\ToggleSwitch.as:537]
	at qnx.ui.slider::Slider/doThumbUp()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\slider\Slider.as:535]
	at qnx.ui.buttons::ToggleSwitch/doThumbUp()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\buttons\ToggleSwitch.as:508]
	at qnx.ui.slider::Slider/onThumbUp()[E:\hudson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\slider\Slider.as:529]

 So basically the same thing... Strange things happen

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: qnx.ui.listClasses.DropDown strange TypeError

I think it has to do that you are trying to add a QNX component to a MX UIComponent. Try adding it to a Sprite. I know that those have tried the MXML route (vs. pure AS3) have had troubles of one sort or another.
Please use plain text.
Contributor
dukebigalow
Posts: 18
Registered: ‎03-17-2012
My Device: playbook
My Carrier: mobitel

Re: qnx.ui.listClasses.DropDown strange TypeError

Made a class simple:

package 
{
	import flash.display.Sprite;
	
	import qnx.ui.buttons.ToggleSwitch;
	
	public class MySprTog extends Sprite
	{
		private var tog:ToggleSwitch;
		
		public function MySprTog()
		{
			super();
			tog = new ToggleSwitch();
			addChild(tog);
		}
	}
}

 

<s:SpriteVisualElement id="elem" width="100" height="50" horizontalCenter="0" verticalCenter="0"/>

 added:

elem.addChild(new MySprTog());

Switch is shown... but on toggle is the same error
There must be something I'm missing. 

Please use plain text.
Developer
pyth
Posts: 506
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: qnx.ui.listClasses.DropDown strange TypeError

judging from your stacktrace i'd say it's an SDK mismatch. As you say, you used 1.1.1 before, so it's like you use the Tweener of 1.1.1 and the ToggleSwitch of 1.1.1, so it works. After you switched to 2.0, one of those, likely the ToggleSwitch, became 2.0, while the Tweener still seems to be at 1.1.1, that's why you can't cast a 1.1.1 Tweener to a 2.0 Tweener

 

I'm not sure though what you could do as solution. I'm not even sure if it's because you're using Flex. Have you checked compability of Flex with 2.0? Elsewise, try to remove everything that could relate to the old SDK, and if that shouldn't work, just keep using the old SDK :/

 

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Please use plain text.
Contributor
dukebigalow
Posts: 18
Registered: ‎03-17-2012
My Device: playbook
My Carrier: mobitel

Re: qnx.ui.listClasses.DropDown strange TypeError

Ok now... I have found the source of all problems... But I don't understand, how that could be possible.

Let me explain:
Flex app with multiple views. One is the main view and others are on top (alone or viewnavigator)
So I started to delete views, until I found the one, that was responsible.
The best of all was, that none of the QNX elements were on that view... How cool is that.

Then I started to delete some elements from that view until I came across 2 spark TextInput-s, that caused the error.

After I replaced them with the QNX textinput, all went smooth.
I am not able to explain, how that could happen.

So that is the tail of the mysterious TypeError... thanx for your help folks... and we see us in the next battle :smileywink: 

Please use plain text.