05-28-2012 11:07 AM
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\cauri na\transitions\Tweener.as:215] at qnx.ui.listClasses::List/showShadows()[E:\hudson\w orkspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx \ui\listClasses\List.as:2594] at qnx.ui.listClasses::List/draw()[E:\hudson\workspac e\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\lis tClasses\List.as:1595] at qnx.ui.core::UIComponent/drawNow()[E:\hudson\works pace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\ core\UIComponent.as:335] at qnx.ui.listClasses::DropDown/updateAllData()[E:\hu dson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\s rc\qnx\ui\listClasses\DropDown.as:1019] at qnx.ui.listClasses::DropDown/draw()[E:\hudson\work space\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\qnxscree n\src\qnx\ui\core\UIComponent.as:304] at qnx.ui.core::UIComponent/callLaterHandler()[E:\hud son\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\sr c\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!
Solved! Go to Solution.
05-29-2012 08:03 AM
05-29-2012 08:22 AM
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
05-29-2012 08:58 AM
05-29-2012 10:56 AM
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\cauri na\transitions\Tweener.as:215] at qnx.ui.buttons::ToggleSwitch/animateThumbTo()[E:\h udson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\ src\qnx\ui\buttons\ToggleSwitch.as:563] at qnx.ui.buttons::ToggleSwitch/handleThumbUp()[E:\hu dson\workspace\AIR_SDK_API_RELEASE\src\qnxscreen\s rc\qnx\ui\buttons\ToggleSwitch.as:537] at qnx.ui.slider::Slider/doThumbUp()[E:\hudson\worksp ace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\s lider\Slider.as:535] at qnx.ui.buttons::ToggleSwitch/doThumbUp()[E:\hudson \workspace\AIR_SDK_API_RELEASE\src\qnxscreen\src\q nx\ui\buttons\ToggleSwitch.as:508] at qnx.ui.slider::Slider/onThumbUp()[E:\hudson\worksp ace\AIR_SDK_API_RELEASE\src\qnxscreen\src\qnx\ui\s lider\Slider.as:529]
So basically the same thing... Strange things happen
05-29-2012 11:04 AM
05-29-2012 11:28 AM
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.
05-30-2012 03:06 AM
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 :/
05-30-2012 10:18 AM
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