Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-01-2003, 04:47 PM   #1
brnwdrng
Registered User
 
brnwdrng's Avatar
 
Join Date: Feb 2002
Location: Billings, MT
Posts: 11
Question NetConnection.call

I can't seem to get this function to work; perhaps I've misunderstood how it is used. I simply want to call a function residing on an aspx page from my a flash SWF on the same page.

My flash movie resides on webroot/flashremoting/bw/parentPage.aspx, and contains:

ActionScript Code:
// my flash app "test.swf" sitting on parentPage.aspx #include "NetServices.as" var msg = "hello"; if (inited == null) {     inited = true;     NetServices.setDefaultGatewayUrl("http://localhost/flashremoting/gateway.aspx");     gatewayConnection = NetServices.createGatewayConnection();     objConnection = gatewayConnection.getService("flashremoting.bw", this); } function button_Clicked(){     objConnection.parentPage();     objConnection.call("parentPage.displayAlert", null, msg); }

... and flashremoting/bw/parentPage.aspx contains:

<%@ Page language="C#" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="FlashGateway" Assembly="flashgateway" %>

<script language="C#" runat="server">

void Page_Load(Object source, EventArgs e)
{
Flash.Result = "This is a test.";
displayAlert("initial value");
}

public void displayAlert(String message)
{
alert.Text = message;
}

</script>

<MM:Flash ID="Flash" runat="server" />

<html><head><title>test</title></head><body>
<object>..."test.swf" typical flash applet embed code here...</object>
<br />
<asp:label ID="alert" runat="server" />
</body></html>

I've left out the _Result and _Status functions in the AS above; the result of "This is a test" is successfully returned to a text field in my flash object, but my call to displayAlert() fails to work and change the alert label from "initial value" to "hello".

brnwdrng is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.