Re: [flexcoders] page change not work when loaded(FB2 beta2 + ColdFusion) [Roger Needed?]

2006-05-19 Thread ZhaoXingdong



hi Matt;

I confirmed under B3 and found the error is still there.

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.messaging.messages::[EMAIL PROTECTED] to
mx.messaging.messages.IMessage.

I found the error is there just because mx.rpc.remoting.RemoteObject is
defined both in List.as and Add.as. I tried changing the variable name
with no luck. But if I comment out the variable definition in Add.as,
the program worked(Of course in this case I didn't get the result I
wished).

In both files the definition is something like this:
private var _myRemoteObject:RemoteObject = new RemoteObject(ColdFusion);

I suppose there might still be something wrong with loading RemoteObject
in B3 like you said.

Thanks in advance.

-xd

On Mon, 24 Apr 2006 20:59:50 -0700
Matt Chotin [EMAIL PROTECTED] wrote:

 I believe this might be a bug in Beta 2 which we're hoping is fixed in
 Beta 3. The problem is that some classes get loaded in the main swf and
 some classes get loaded into the child swf and sometimes the VM gets
 screwed up in reconciling everything.
 
 Let's see if I put the word Roger in here (and in the subject) if he
 happens to see and can confirm.
 
 Matt
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of ZhaoXingdong
 Sent: Monday, April 24, 2006 7:26 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] page change not work when loaded(FB2 beta2 +
 ColdFusion)
 
 hi flexcoders;
 
 The idea is I have a container swf, a list swf and an add swf.
 When container swf is running, it first loads the list swf and
 displays some buttons like add. The list swf displays data in
 several pages and you can change the page with a horizontal slide. When
 add button is clicked, the add swf is loaded and displayed with some
 buttons like cancel, submit and clear. And in add swf, when
 cancel button is clicked, the container swf should display the
 list
 swf with its current state.
 
 It's really disturbing me because when list swf runs as a single swf,
 page changing works ok, but when it's running as a loaded swf by
 container swf, page changing gave me the following two errors:
 
 TypeError: Error #1034: Type Coercion failed: cannot convert
 mx.messaging.messages::[EMAIL PROTECTED] to
 mx.messaging.messages.Message
 
 TypeError: Error #1034: Type Coercion failed: cannot convert
 mx.messaging.messages::[EMAIL PROTECTED] to
 mx.messaging.messages.Message
 
 I guess I must have missed something but I tried with no luck. And I
 just couldn't figure out why the errors only occured when loaded.
 
 Any help would be appreciated.
 
 -xd
 
 List.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
 layout=absolute creationComplete=InitApp()
 mx:Script source=List.as/
 mx:Panel title=List width=95%
 mx:DataGrid id=dg dataProvider={svc.getList.result}
 width=100% rowCount=2
 mx:columns
 mx:DataGridColumn headerText=Name
 dataField=apm_name/
 mx:DataGridColumn
 headerText=Description dataField=apm_desc/
 /mx:columns
 /mx:DataGrid
 mx:HBox width=100%
 mx:Spacer width=25%/
 mx:HSlider id=hsldPageNo width=50%
 minimum=1 maximum={svc.getPageCounts.result} tickInterval=1
 snapInterval=1 dataTipPlacement=bottom
 dataTipFormatFunction=pageToolTipFunc change=pageChange(event);/
 mx:Spacer width=25%/
 /mx:HBox
 /mx:Panel
 mx:RemoteObject id=svc destination=ColdFusion
 source=cf.ap/
 /mx:Application
 
 List.as
 import mx.events.SliderEvent;
 public function InitApp():void {
 getInfo(0);
 }
 public function getInfo(nPageNo:int):void {
 svc.getList(nPageNo);
 svc.getPageCounts();
 }
 private function pageChange(event:SliderEvent):void {
 getInfo(event.currentTarget.value - 1);
 }
 private function pageToolTipFunc(val:String):String {
 return page  + int(val);
 }
 
 
 Add.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
 layout=absolute
 mx:Script source=Add.as/
 mx:Panel title=AddForm width=95%
 mx:Form width=100%
 mx:FormItem label=Name required=true
 mx:TextInput id=txtiName/
 /mx:FormItem
 mx:FormItem label=Description
 mx:TextInput id=txtiDesc/
 /mx:FormItem
 mx:HBox width=100%
 mx:Button label=Cancel
 click=cancelAction();/
 mx:Spacer width=100%/
 mx:Button label=Reset
 click=clearAction();/
 mx:Button label=Submit
 click=addAction();/
 /mx:HBox
 /mx:Form
 /mx:Panel
 /mx:Application
 
 Add.as
 public function addAction():void {
 clearForm();
 if(this.automationParent) {
 var obj:Object =
 Object(this).automationParent.parentApplication;
 obj.afterAdd(addok);
 }
 }
 public function cancelAction():void {
 clearForm();
 if(this.automationParent) {
 var obj:Object =
 Object(this).automationParent.parentApplication;
 obj.afterAdd(cancel);
 }
 }
 public function clearAction():void {
 clearForm();
 }
 public function clearForm():void {
 txtiName.text = ;
 txtiDesc.text = ;
 }
 
 
 Container.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application 

Re: [flexcoders] page change not work when loaded(FB2 beta2 + ColdFusion) [Roger Needed?]

2006-04-26 Thread ZhaoXingdong



Thanks Matt.

Because maybe swf's loaded function is an important issue when
constructing a relatively larger application. It would be greatly
appreciated if it could be fixed as a bug.

I would confirm it when Beta 3 is public released.

cheers,

-xd

On Mon, 24 Apr 2006 20:59:50 -0700
Matt Chotin [EMAIL PROTECTED] wrote:

 I believe this might be a bug in Beta 2 which we're hoping is fixed in
 Beta 3. The problem is that some classes get loaded in the main swf and
 some classes get loaded into the child swf and sometimes the VM gets
 screwed up in reconciling everything.
 
 Let's see if I put the word Roger in here (and in the subject) if he
 happens to see and can confirm.
 
 Matt
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of ZhaoXingdong
 Sent: Monday, April 24, 2006 7:26 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] page change not work when loaded(FB2 beta2 +
 ColdFusion)
 
 hi flexcoders;
 
 The idea is I have a container swf, a list swf and an add swf.
 When container swf is running, it first loads the list swf and
 displays some buttons like add. The list swf displays data in
 several pages and you can change the page with a horizontal slide. When
 add button is clicked, the add swf is loaded and displayed with some
 buttons like cancel, submit and clear. And in add swf, when
 cancel button is clicked, the container swf should display the
 list
 swf with its current state.
 
 It's really disturbing me because when list swf runs as a single swf,
 page changing works ok, but when it's running as a loaded swf by
 container swf, page changing gave me the following two errors:
 
 TypeError: Error #1034: Type Coercion failed: cannot convert
 mx.messaging.messages::[EMAIL PROTECTED] to
 mx.messaging.messages.Message
 
 TypeError: Error #1034: Type Coercion failed: cannot convert
 mx.messaging.messages::[EMAIL PROTECTED] to
 mx.messaging.messages.Message
 
 I guess I must have missed something but I tried with no luck. And I
 just couldn't figure out why the errors only occured when loaded.
 
 Any help would be appreciated.
 
 -xd
 
 List.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
 layout=absolute creationComplete=InitApp()
 mx:Script source=List.as/
 mx:Panel title=List width=95%
 mx:DataGrid id=dg dataProvider={svc.getList.result}
 width=100% rowCount=2
 mx:columns
 mx:DataGridColumn headerText=Name
 dataField=apm_name/
 mx:DataGridColumn
 headerText=Description dataField=apm_desc/
 /mx:columns
 /mx:DataGrid
 mx:HBox width=100%
 mx:Spacer width=25%/
 mx:HSlider id=hsldPageNo width=50%
 minimum=1 maximum={svc.getPageCounts.result} tickInterval=1
 snapInterval=1 dataTipPlacement=bottom
 dataTipFormatFunction=pageToolTipFunc change=pageChange(event);/
 mx:Spacer width=25%/
 /mx:HBox
 /mx:Panel
 mx:RemoteObject id=svc destination=ColdFusion
 source=cf.ap/
 /mx:Application
 
 List.as
 import mx.events.SliderEvent;
 public function InitApp():void {
 getInfo(0);
 }
 public function getInfo(nPageNo:int):void {
 svc.getList(nPageNo);
 svc.getPageCounts();
 }
 private function pageChange(event:SliderEvent):void {
 getInfo(event.currentTarget.value - 1);
 }
 private function pageToolTipFunc(val:String):String {
 return page  + int(val);
 }
 
 
 Add.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
 layout=absolute
 mx:Script source=Add.as/
 mx:Panel title=AddForm width=95%
 mx:Form width=100%
 mx:FormItem label=Name required=true
 mx:TextInput id=txtiName/
 /mx:FormItem
 mx:FormItem label=Description
 mx:TextInput id=txtiDesc/
 /mx:FormItem
 mx:HBox width=100%
 mx:Button label=Cancel
 click=cancelAction();/
 mx:Spacer width=100%/
 mx:Button label=Reset
 click=clearAction();/
 mx:Button label=Submit
 click=addAction();/
 /mx:HBox
 /mx:Form
 /mx:Panel
 /mx:Application
 
 Add.as
 public function addAction():void {
 clearForm();
 if(this.automationParent) {
 var obj:Object =
 Object(this).automationParent.parentApplication;
 obj.afterAdd(addok);
 }
 }
 public function cancelAction():void {
 clearForm();
 if(this.automationParent) {
 var obj:Object =
 Object(this).automationParent.parentApplication;
 obj.afterAdd(cancel);
 }
 }
 public function clearAction():void {
 clearForm();
 }
 public function clearForm():void {
 txtiName.text = ;
 txtiDesc.text = ;
 }
 
 
 Container.mxml
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
 layout=absolute backgroundColor=#FF
 mx:Script source=Container.as/
 mx:VBox width=95% height=95% horizontalAlign=center
 mx:ViewStack id=vstk width=100% height=100%
 change=changeDisplay(event);
 mx:Panel id=cnvList label=List width=100%
 height=100%
 mx:Button label=Add
 click=toAddForm();/
 mx:Loader id=ldrList width=100%
 height=100% source=List.swf/
 /mx:Panel
 mx:Panel id=cnvAdd label=Add width=100%
 height=100%
 mx:Loader id=ldrAdd width=100%
 height=100% 

RE: [flexcoders] page change not work when loaded(FB2 beta2 + ColdFusion) [Roger Needed?]

2006-04-24 Thread Matt Chotin



I believe this might be a bug in Beta 2 which we're hoping is fixed in
Beta 3. The problem is that some classes get loaded in the main swf and
some classes get loaded into the child swf and sometimes the VM gets
screwed up in reconciling everything.

Let's see if I put the word Roger in here (and in the subject) if he
happens to see and can confirm.

Matt

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ZhaoXingdong
Sent: Monday, April 24, 2006 7:26 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] page change not work when loaded(FB2 beta2 +
ColdFusion)

hi flexcoders;

The idea is I have a container swf, a list swf and an add swf.
When container swf is running, it first loads the list swf and
displays some buttons like add. The list swf displays data in
several pages and you can change the page with a horizontal slide. When
add button is clicked, the add swf is loaded and displayed with some
buttons like cancel, submit and clear. And in add swf, when
cancel button is clicked, the container swf should display the
list
swf with its current state.

It's really disturbing me because when list swf runs as a single swf,
page changing works ok, but when it's running as a loaded swf by
container swf, page changing gave me the following two errors:

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.messaging.messages::[EMAIL PROTECTED] to
mx.messaging.messages.Message

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.messaging.messages::[EMAIL PROTECTED] to
mx.messaging.messages.Message

I guess I must have missed something but I tried with no luck. And I
just couldn't figure out why the errors only occured when loaded.

Any help would be appreciated.

-xd

List.mxml
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
layout=absolute creationComplete=InitApp()
 mx:Script source=List.as/
 mx:Panel title=List width=95%
  mx:DataGrid id=dg dataProvider={svc.getList.result}
width=100% rowCount=2
   mx:columns
mx:DataGridColumn headerText=Name
dataField=apm_name/
mx:DataGridColumn
headerText=Description dataField=apm_desc/
   /mx:columns
  /mx:DataGrid
  mx:HBox width=100%
   mx:Spacer width=25%/
   mx:HSlider id=hsldPageNo width=50%
minimum=1 maximum={svc.getPageCounts.result} tickInterval=1
snapInterval=1 dataTipPlacement=bottom
dataTipFormatFunction=pageToolTipFunc change=pageChange(event);/
   mx:Spacer width=25%/
  /mx:HBox
 /mx:Panel
 mx:RemoteObject id=svc destination=ColdFusion
source=cf.ap/
/mx:Application

List.as
import mx.events.SliderEvent;
public function InitApp():void {
 getInfo(0);
}
public function getInfo(nPageNo:int):void {
 svc.getList(nPageNo);
 svc.getPageCounts();
}
private function pageChange(event:SliderEvent):void {
 getInfo(event.currentTarget.value - 1);
}
private function pageToolTipFunc(val:String):String {
 return page  + int(val);
}


Add.mxml
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
layout=absolute
 mx:Script source=Add.as/
 mx:Panel title=AddForm width=95%
  mx:Form width=100%
   mx:FormItem label=Name required=true
mx:TextInput id=txtiName/
   /mx:FormItem
   mx:FormItem label=Description
mx:TextInput id=txtiDesc/
   /mx:FormItem
   mx:HBox width=100%
mx:Button label=Cancel
click=cancelAction();/
mx:Spacer width=100%/
mx:Button label=Reset
click=clearAction();/
mx:Button label=Submit
click=addAction();/
   /mx:HBox
  /mx:Form
 /mx:Panel
/mx:Application

Add.as
public function addAction():void {
 clearForm();
 if(this.automationParent) {
  var obj:Object =
Object(this).automationParent.parentApplication;
  obj.afterAdd(addok);
 }
}
public function cancelAction():void {
 clearForm();
 if(this.automationParent) {
  var obj:Object =
Object(this).automationParent.parentApplication;
  obj.afterAdd(cancel);
 }
}
public function clearAction():void {
 clearForm();
}
public function clearForm():void {
 txtiName.text = ;
 txtiDesc.text = ;
}


Container.mxml
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns=*
layout=absolute backgroundColor=#FF
 mx:Script source=Container.as/
 mx:VBox width=95% height=95% horizontalAlign=center
  mx:ViewStack id=vstk width=100% height=100%
change=changeDisplay(event);
   mx:Panel id=cnvList label=List width=100%
height=100%
mx:Button label=Add
click=toAddForm();/
mx:Loader id=ldrList width=100%
height=100% source=List.swf/
   /mx:Panel
   mx:Panel id=cnvAdd label=Add width=100%
height=100%
mx:Loader id=ldrAdd width=100%
height=100% source=Add.swf/
   /mx:Panel
  /mx:ViewStack
 /mx:VBox
/mx:Application

Container.as
import mx.events.IndexChangedEvent;
public function toList():void {
 vstk.selectedIndex = 0;
}
public function toAddForm():void {
 vstk.selectedIndex = 1;
}
public function afterAdd(status:String):void {
 if(status == addok)
  toList();
 if(status == cancel)
  toList();
}