Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / October 2005



Tip: Looking for answers? Try searching our database.

Error opening include file NetServices.as

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Emmersive media - 20 Oct 2005 04:22 GMT
Hi,

Im very new to Flash remoting so I will give a run down of what im trying to
do. First of all I am using ASP.NET with Flash Remoting and using Flash Pro
2004.

I want to try to get an ASP.NET page to return a datareader object or dataset
object to flash that can be used to build a custom menu.

When I try to run the flash movie in "test" mode i get the following errors in
the output window ( i also get the same errors for the supplied examples,
although when run through a web browser the examples work fine.)

**Error** Scene=Scene 1, layer=Actions, frame=1:Line 1: Error opening include
file NetServices.as: File not found.

**Error** Scene=Scene 1, layer=Actions, frame=1:Line 3: Error opening include
file NetDebug.as: File not found.
     #include "NetDebug.as"

my Actionscript is as follows and is located on the first frame of the movie:

#include "NetServices.as"

#include "NetDebug.as"

function init()
{
    if (this.inited != undefined)
    {
        // * TRAP: if this function has already been invoked, break out, and continue
        return;
    }
    else
    {
        // * Execute the following script if the function has not run.  The
following initializes
        // * the connection to the Flash Remoting MX server
        this.inited = true;
        NetServices.setDefaultGatewayUrl("http://localhost/aps/flashNav.aspx");
        gatewayConnnection = NetServices.createGatewayConnection();

        // * Set the name of the namespace where your ASP.NET files will be called
from,
        // * then open the connection under the instance name "flashService".
        defaultService = "aps";
        flashService = gatewayConnnection.getService(defaultService, this);
       
    }
}
function getCategories(myCategoryTable, myCategoryAtt)
{
    flashService.flashNav(myCategoryTable, myCategoryAtt);
}

function flashNav_Result(result)
{
    myResult.text = result;
}

getCategories("products", "prod");

My location of the application is "http://localhost/aps/"
and the aspx page is "http://localhost/aps/flashNav.aspx"

The code for the apsx page is as follows

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="flashNav.aspx.vb"
Inherits="aps.flashNav"%>
<%@Register TagPrefix="Macromedia" Namespace="FlashGateway"
Assembly="flashgateway"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>flashNav</title>
        <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body>
        <Macromedia:Flash ID="Flash" Runat="Server" />
    </body>
</HTML>

And the code behind is:

Public Class flashNav
    Inherits System.Web.UI.Page
    Protected Flash As FlashGateway.Flash

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

    End Sub

    '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

    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

        ' This sub recives a parameter from the flash navigation file and then
returns to the
        ' flash movie a recordset of the categories contained to build the
menu from

        Dim myAdminDB As New adminDB
        Dim myResults As Odbc.OdbcDataReader

        ' Delcare and get DB parameters
        Dim dbServer As String = Application("glbServerName")
        Dim dbName As String = Application("glbDBName")
        Dim dbDriver As String = Application("glbDBDriver")
        Dim dbUser As String = Application("glbPubUsr")
        Dim dbPass As String = Application("glbPubPass")

        ' Check for parameters passed from flash
        ' If Flash.Params.Count > 0 Then

            ' if parameter is passed get the data from the db and return it
            ' Create sql query and get results
            Dim myCategoryType As String = Flash.Params(0).ToString()
            Dim myCategoryAtrribute As String = Flash.Params(0).ToString

            Dim myQuery As String
            myQuery = "SELECT * FROM " + myCategoryType + "_category ORDER BY
" + myCategoryAtrribute + "_name;"
            myResults = myAdminDB.runQuery(dbDriver, dbServer, dbName, dbUser,
dbPass, myQuery)

            Flash.DataSource = myResults
            Flash.DataBind()

        myAdminDB.myConnection.Close()
        Console.Write("Something")

        ' Else
            ' if no parameters are passed return an error

        ' End If
    End Sub

End Class

I have installed the "flashremoting_comp_as20-win-en.exe" which is the flash
remoting components.

So my problem is 'im not sure if any of it is running because the debugger
does not run and I can't seem to get the netconnect debugger to run. I have
looked at the examples provided with the flashremoting and also looked at
examples at Jassonperry.com but nothing is helping me yet.

Thanks in advance.

Glen

PS the message board has parsed some of the code as links and changed the way
it was, i think the code originally is correct.
mikew909 - 20 Oct 2005 07:53 GMT
I had the same problem this week.  I think the cause was using the actionscript
2.0 components for flash 8 with v. 7.0/7.2. I removed remoting components and
flash remoting and reinstalled using the earlier version of components.
all fixed!
some boards might say use
import mx.remoting.*   instead of #include....
but i didnt have much luck with this
anyway see how you get on... use the earlier flash remoting download
later
Emmersive media - 29 Oct 2005 07:41 GMT
Hi,

Thanks for your reply,

I tried to install earlier versions of the flash remoting components but that
didnt seem to help, I think the problem was that Flash was setup to use AS1.0
not AS2.0, It seems to work fine with the dot syntax and using AS2.0.

Thanks Again.

Glen
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.