Hi,
I have a problem with Flash remoting via .NET . I seem to have all the code
right, but flash does not seem to display the data at all.
Here's is what Ive done so far...
(1) Ive installed Flash Remoting MX, and copied over the contents of
wwwroot\flashremoting\bin into my web application's folder\bin.
(2) In my web application, I have included the FlashGateway.dll as a reference.
(3) The aspx file that holds the embed tag for the flash control has the
following code:
<OBJECT id="template1"
codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=7,0,0,0"
height="550" width="600" align="middle" classid="clsid:
d27cdb6e-ae6d-11cf-96b8-444553540000"
VIEWASTEXT>
<PARAM NAME="_cx" VALUE="15875">
<PARAM NAME="_cy" VALUE="14552">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie"
VALUE="template.swf?gatewayPath=http://localhost/MyWebApp/gateway.aspx">
<PARAM NAME="Src"
VALUE="template.swf?gatewayPath=http://localhost/MyWebApp/gateway.aspx">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="sameDomain">
<PARAM NAME="Scale" VALUE="NoBorder">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<embed
src="template.swf?gatewayPath=http://localhost/MyWebApp/gateway.aspx"
width="650" height="600" id="Template" align="middle"/>
</embed>
</OBJECT>
(4) The gateway.aspx file referred to is a blank (default) aspx file available
in the Web App's path.
(5) The flash file "template.swf" is also available in the Web App's path.
(6) The "template.swf" file has the code burnt in to refer to
"dataToFlash.aspx" to get the input data in the form of an XML string.
(7) In the "dataToFlash.aspx" I have the Register directive:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="dataToFlash.aspx.vb" Inherits="VentureMap.dataToFlash"%>
<%@ Register TagPrefix="MM" Namespace="FlashGateway" Assembly="flashgateway" %>
(8) The "dataToFlash.aspx" has the default Web Form Designer code after adding
the Register directive:
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents Flash As FlashGateway.Flash
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
(9) The function call to Page_Load in "dataToFlash.aspx" is as follows:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim xmlDoc As New XmlDocument
xmlDoc.Load("XMLTemplate.xml")
Dim sw As New StringWriter
Dim xw As New XmlTextWriter(sw)
xmlDoc.WriteTo(xw)
Dim strXMLOutput As String
strXMLOutput = sw.ToString()
Flash.Result = strXMLOutput
End Sub
I have tested that the "strXMLOutput" variable has the correct and entire XML
output from the xml file.
(10) The "template.swf" has the script built in to read the input XML string,
parse it, and display data within the flash controls.
But the flash control on the browser, never seems to read the data and display
it.
Is there anything Im missing ? Are any of these declarations / object-naming
portions case-sensitive ?
Ive tried everything I could find on various message groups / Google /
Macromedia FAQ.
If anyone could help me out, it would be just great.
Thanks,
Uma Vivek
chrispix - 19 Nov 2004 00:09 GMT
Did you purchase a license? Apparently the developer license only allows you to
connect from the same IP address the server is running on. In any case, try
adding this line to the beginning of your actionscript:
#include NetDebug.as
Then publish, deploy, and try again. In Flash, you can then open the net
connection debugger (Window->NetConnection Debugger), and when you try to run
the swf, you should see messages in the debugger explaining whether it's
connecting and getting any data.
bandward - 19 Nov 2004 00:25 GMT
You didn't output the actionscript in the Flash File but what do you have
defined as your gateway? You have something called
gatewayPath=http://localhost/MyWebApp/gateway.aspx as below: <embed
src='template.swf?gatewayPath=http://localhost/MyWebApp/gateway.aspx'
width='650' height='600' id='Template' align='middle'/> </embed> Don't know
much about .NET but your gatewayUrl variable should be defined as (if you're
doing this on your local coldfusion server):
NetServices.setDefaultGatewayUrl('http://localhost:8100/flashservices/gateway')
Barb
Elangovan - 20 Nov 2004 05:47 GMT
Hi, easiest way is to put the code inside the timeline var connect:Service
= new Service( 'http://localhost/flashremoting/gateway.aspx', null,
'flashremoting.samples.xxx', null, null ); var login : PendingCall =
connect.dataToFlash(); login.responder = new RelayResponder( this,
'gotLogin','gotLogin_Fault'); function gotLogin(re:ResultEvent):Void{
trace(re.result); } function gotLogin_Fault(fe:FaultEvent):Void{
trace('error - on Login'+fe.fault.faultstring + newline + 'Invalid Entry...');
} tx Elan