Archive for December, 2005
This is a summary of some discussions on the flexcoders yahoo group.
As for a summary, Peter breaks it down pretty well. We have actually confused to issues together:
1.) “AMF protocol versions”
2.) “Flex 1.5 styled RemoteObject in Flex 2″
Details on the 2 issues:
All AMF protocol versions should work as Flash Players progress. This is what has happened in the past and has been stated what will happen in the future. So the actual protocols will work. The component/class wrappers change over time. And then it comes down to Adobe making the choice of which component/classes end up in there class packages.
The 2nd issue is about the classes/components that provide the means and methods of connecting and using the protocols. Between Flex1.5, Flex2, Flash MX, Flash 8 etc… there have been different implementations of classes and/or components. Personally one of the nice features of Flex has been the Data Services components (Flex 1.5 term, in Flex2 they are called RPC services as Data Services refers to new methods of connecting to data, which means I will refer to RemoteObject by RPC Services from now on out). The RPC services, RemoteObject, HTTPService and WebService components/classes have gotten a overhaul in Flex2 Alpha to facilitate the new AMF3 feature. Please also note that the Flex2 components/classes are not final. Ok here comes the main concern of certain people and that is the lose of out of the box components/classes that can be used to connect to AMF version 1/2 gateways the same way they do now. Logically all one would have to do is create such a component/class, this is what I am looking into. Please note that this is not a solution but more of a migrating tool and that we really should consider moving to Flex2’s new version/component/classes when possible etc…
Its the drastic change of how Flex2 handles AMF connections that is probably causing all the confusion. As it uses a destination in the client RemoteObject level that is mapped to a configuration file that then is mapped to a channel. This method is roughly called the “Adapter” method? We’ll see implementations of using this method come forth for all of the current AMF implementations. Once this happens some of these issues should be alleviated a little.
December 17th, 2005
Three files in this example, CreateDestroyIssue.mxml, test/MainPage.mxml, and test1/MainPage.mxml. The issue is that test/MainPage.mxml is a VBox and test1/MainPage.mxml is a Panel. When test1/MainPage.mxml is created some of the styles are not correct, for example the round edges of the panel header. This only happens on files with the same name, even though they are in different directories.
Example code:
CreateDestroyIssue.mxml
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
-
width="100%" height="100%" initialize="createUI( 'pageVBox' )">
-
-
<mx:Script>
-
<![CDATA[
-
import mx.core.UIObject;
-
public var pageItem : Object;
-
-
function createUI( pageUI:String ):Void {
-
if( pageUI == "pageVBox" )
-
pageItem = vsPageHolder.createChild( test.MainPage, undefined );
-
if( pageUI == "pagePanel" )
-
pageItem = vsPageHolder.createChild( test1.MainPage, undefined );
-
}
-
-
public function destroyUI():Void {
-
vsPageHolder.destroyChild( UIObject( pageItem ) );
-
}
-
]]>
-
</mx:Script>
-
<mx:HBox width="100%" textAlign="center" backgroundColor="#DDDDDD">
-
<mx:Text text="Select a Combo Box item: " width="200" textAlign="right"/>
-
<mx:ComboBox id="cmbPages" change="destroyUI();createUI( cmbPages.selectedItem.data );">
-
<mx:dataProvider>
-
<mx:Array>
-
<mx:Object data="pageVBox" label="Page with VBox"/>
-
<mx:Object data="pagePanel" label="Page with Panel"/>
-
</mx:Array>
-
</mx:dataProvider>
-
</mx:ComboBox>
-
</mx:HBox>
-
<mx:ViewStack id="vsPageHolder" width="100%" height="100%">
-
</mx:ViewStack>
-
</mx:Application>
test/MainPage.mxml
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml"
-
width="100%" height="200"
-
backgroundColor="0x99BB66">
-
<mx:Text text="VBox Page, Hello World!"/>
-
</mx:VBox>
test1/MainPage.mxml
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml"
-
width="50%" height="300"
-
backgroundColor="0x6699BB">
-
<mx:Text text="Panel Page, Hello World!"/>
-
</mx:Panel>
Fix 2006.01.18:
When the file names are the same Flex has this problem. If the file names are different it works. It has something to do with Flex using filenames as an internal identifier during the compiling process/runtime process.
December 14th, 2005
Create three files called CreateDestroyChild.mxml, VBoxPage.mxml and PanelPage.mxml.
CreateDestroyChild.mxml:
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
-
width="100%" height="100%" initialize="createUI( 'pageVBox' )">
-
-
<mx:Script>
-
<![CDATA[
-
import mx.core.UIObject;
-
public var pageItem : Object;
-
-
function createUI( pageUI:String ):Void {
-
if( pageUI == "pageVBox" )
-
pageItem = vsPageHolder.createChild( VBoxPage, undefined );
-
if( pageUI == "pagePanel" )
-
pageItem = vsPageHolder.createChild( PanelPage, undefined );
-
}
-
-
public function destroyUI():Void {
-
vsPageHolder.destroyChild( UIObject( pageItem ) );
-
}
-
]]>
-
</mx:Script>
-
<mx:HBox width="100%" textAlign="center">
-
<mx:ComboBox id="cmbPages" change="destroyUI();createUI( cmbPages.selectedItem.data );">
-
<mx:dataProvider>
-
<mx:Array>
-
<mx:Object data="pageVBox" label="Page with VBox"/>
-
<mx:Object data="pagePanel" label="Page with Panel"/>
-
</mx:Array>
-
</mx:dataProvider>
-
</mx:ComboBox>
-
<mx:Button label="Destroy UI" click="destroyUI();" />
-
<mx:Button label="Create UI" click="createUI( cmbPages.selectedItem.data );" />
-
</mx:HBox>
-
<mx:ViewStack id="vsPageHolder" width="100%" height="100%">
-
</mx:ViewStack>
-
</mx:Application>
VBoxPage.mxml
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml"
-
width="200" height="200"
-
backgroundColor="0x996633">
-
<mx:Text text="VBox Page, Hello World!"/>
-
</mx:VBox>
PanelPage.mxml:
XML:
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml"
-
width="300" height="300"
-
backgroundColor="0x336699">
-
<mx:Text text="Panel Page, Hello World!"/>
-
</mx:Panel>
This simple example shows the power of dynamically creating and destroy components at runtime.
December 13th, 2005
When I connect Flex 2 and AMFPHP using the code below I get a "ReferenceError: Error #1069: Property AppendToGatewayUrl not found on flash.net.NetConnection and there is no default value".
Continue Reading December 11th, 2005
Changing the Endpoint URL of a webservice in ColdFusionMX 7 was not as easy as it seemed. I received this bit of information from some ColdFusion guru's.
JAVASCRIPT:
-
<cfscript>
-
ws = CreateObject("webservice", "http://localhost:8500/service.cfc?WSDL");
-
// Use a different endpoint for the stub.
-
ws._setProperty("javax.xml.rpc.service.endpoint.address", "http://localhost:8501/service.cfc");
-
ret = ws.echo("Through the tunnel");
-
</cfscript>
December 9th, 2005
We had a problem with a DHTML popup menu being rendered behind any flash content.
Code that is needed:
HTML:
-
<div id="swfContainer" style="z-index:0;">
-
<param name="wmode" value="transparent">
-
<embed src="main.swf" wmode="transparent"...
Continue Reading December 8th, 2005