Adobe Dreamweaver Forums



Last 10 THreads :         Why is this not working!!! (Last Post : Boxing Boom - Replies : 11 - Views : 12 )           »          CF8 Enterprise gives 500 errors (Last Post : BJFranz - Replies : 0 - Views : 1 )           »          cfimage error (Last Post : masoud_amen - Replies : 0 - Views : 1 )           »          Flash Controls Not Displaying in Embedded File (Last Post : QADesign - Replies : 4 - Views : 5 )           »          Scollbar theme (Last Post : vcorey - Replies : 0 - Views : 1 )           »          Scollbar theme (Last Post : vcorey - Replies : 0 - Views : 1 )           »          Flash CS4 constant crashes (Last Post : san_flash - Replies : 5 - Views : 6 )           »          DIV in Table not working. (Last Post : Murray *ACE* - Replies : 11 - Views : 12 )           »          navigation bar in div (Last Post : jody25 - Replies : 2 - Views : 3 )           »          Disabling menu bars in a browser window (Last Post : Jay Jay - Replies : 6 - Views : 7 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-30-2008, 02:14 AM
wallanceM
 
Posts: n/a
Diggs:
Default TypeError: Error #1034 Type Coercion failed

Can someone help me understand where the error is? I don't understand how to
read the errors that the debugger outputs.

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.controls::Text@2f07ccf1 to mx.core.Container.
at mx.controls::NavBar/_setTargetViewStack()
at mx.controls::NavBar/checkPendingTargetStack()
at mx.controls::NavBar/commitProperties()
at mx.controls::ButtonBar/commitProperties()
at mx.controls::ToggleButtonBar/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateClient()
at mx.core::UIComponent/validateNow()
at mx.core::UIComponent/creationCompleteHandler()
at flash.events::EventDispatcher/dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply( )
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-30-2008, 02:33 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1034 Type Coercion failed

If you run in debug mode instead of just the regular run mode, it will give
you line numbers. But it looked like you tried to call a method on a text
control that only exists on a container, or you passed a text control as an
argument to something that needs a container.

HTH;

Amy

"wallanceM" <webforumsuser@macromedia.com> wrote in message
news:ggsshc$av6$1@forums.macromedia.com...
> Can someone help me understand where the error is? I don't understand how
> to
> read the errors that the debugger outputs.
>
> TypeError: Error #1034: Type Coercion failed: cannot convert
> mx.controls::Text@2f07ccf1 to mx.core.Container.
> at mx.controls::NavBar/_setTargetViewStack()
> at mx.controls::NavBar/checkPendingTargetStack()
> at mx.controls::NavBar/commitProperties()
> at mx.controls::ButtonBar/commitProperties()
> at mx.controls::ToggleButtonBar/commitProperties()
> at mx.core::UIComponent/validateProperties()
> at mx.managers::LayoutManager/validateClient()
> at mx.core::UIComponent/validateNow()
> at mx.core::UIComponent/creationCompleteHandler()
> at flash.events::EventDispatcher/dispatchEventFunctio n()
> at flash.events::EventDispatcher/dispatchEvent()
> at mx.core::UIComponent/dispatchEvent()
> at mx.core::UIComponent/set initialized()
> at mx.managers::LayoutManager/doPhasedInstantiation()
> at Function/http://adobe.com/AS3/2006/builtin::apply( )
> at mx.core::UIComponent/callLaterDispatcher2()
> at mx.core::UIComponent/callLaterDispatcher()
>



Reply With Quote
  #3 (permalink)  
Old 12-01-2008, 06:24 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1034 Type Coercion failed

Usually this happens when you try to change the view of a ViewStack, such as:

var myText:Text = new Text();
...
myText.text = "productCatalog";
...
myViewStack.selectedChild = myText;

The ViewStack wants a container for selectedChild, but you are passing a Text
object. It doesn't matter that the value of the Text object text property
(productCatalog) might be the same as the name of a container object within the
ViewStack.

The following code illustrates the problem, with a slightly different error,
and provides one solution:



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Text;

private var myText:Text = new Text();

private function init():void{
myText.text = "view3";
}

private function clickHandler():void{
// Uncomment this line and comment out the line
// after that to see the error:
//myViewStack.selectedChild = myText.text;
myViewStack.selectedChild = this[myText.text];
}
]]>
</mx:Script>
<mx:LinkBar dataProvider="{myViewStack}"/>
<mx:ViewStack id="myViewStack">
<mx:VBox id="view1" label="View1">
<mx:Label text="View 1" fontSize="20"/>
</mx:VBox>
<mx:VBox id="view2" label="View2">
<mx:Label text="View 2" fontSize="20"/>
</mx:VBox>
<mx:VBox id="view3" label="View3">
<mx:Label text="View 3" fontSize="20"/>
</mx:VBox>
</mx:ViewStack>
<mx:Button label="Select View 3"
fontSize="15" click="clickHandler()"/>
</mx:Application>

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 10:59 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk