Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

.NET Flash chat component not pulling in passed in socket and port address parameters

Posted on 2003-10-29
7
Medium Priority
?
174 Views
Last Modified: 2010-07-27
Hi,

I am working on a Shockwave Flash Chat component intended to run under IIS .NET framework with a C# server and want to dynamically pull in server and port address information into the SWF file. I originally attempted to read a web.config xml file which worked fine outside of the IIS .NET environment, unfortunately under IIS it won't serve the config.web file for security reasons. So, it seems that I have to pass the information in as parameters from an .ASPX file, such as:

<embed src="Chat.swf?ipaddress=100.00.55.106&port1=2000" loop="false"
menu="false" quality="high" bgcolor="red" width="600" height="400"
name="Chat" align="middle" allowscriptaccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />

Using this approach, I came up with the following code that is run in the SWF file when the user presses the 'Login' button:

on (release, keyPress "<Enter>") {

// put the user on a 'connection status page' while we load
gotoAndStop("attendere");

// try to connect
if (!socket.connect(ipaddress, port1)) {
trace("Connection failed!");
gotoAndStop("Errore");
}
}

However, it appers to NOT pull in the information.  From everything I have found on the web this is how I understand it to retrieve passed in parameters.  Why is this not working?  Does this perhaps also have to do with the .NET security?  How do I make it work?

A little frustrated,

-Steve

** advertising removed by Netminder, Site Admin **
0
Comment
Question by:falkan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 9646732
Have you tried to trace "ipaddress" and "port1" values? For example, creating two textfields with those variables associated to, and checking for the textfields become populated with expected values?
0
 

Author Comment

by:falkan
ID: 9646809
Yes, if I do a direct connect like this, where Chat.aspx serves the SWF file:

http://10.0.55.106/ChatSetup/Chat.aspx

Content within Chat.aspx:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%">&nbsp;</td>
    <td><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="400" id="Chat" align="middle" >
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="Chat.swf" />
        <param name="loop" value="false" />
        <param name="menu" value="false" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#336699" />
        <embed src="Chat.swf?ipaddress=<%=System.Configuration.ConfigurationSettings.AppSettings["IPAddress"]%>&port1=<%=System.Configuration.ConfigurationSettings.AppSettings["PortNo"]%>" loop="false" menu="false" quality="high" bgcolor="red" width="600" height="400" name="Chat" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </embed>
      </object></td>
    <td width="50%">&nbsp;</td>
  </tr>

Then the values come up NULL.

But, if I serve the SWF directly like this:

http://10.0.55.106/ChatSetup/Chat.swf?ipaddress=10.0.55.106&port1=2000

Then the dynamic text boxes populate with the following proper information:

10.0.55.106
2000

0
 
LVL 27

Expert Comment

by:negatyve
ID: 9648855
I don't know .NET, but can you just show this line


<%=System.Configuration.ConfigurationSettings.AppSettings["IPAddress"]%>

in a aspx page? I mean, are you sure that this works?
0
 

Author Comment

by:falkan
ID: 9653806
Yes, I am sure that this works.  Simply, you can do a 'View Source' on the browser to make sure it resolves to the correct information, as such:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%">&nbsp;</td>
    <td><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="400" id="Chat" align="middle" >
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="Chat.swf" />
        <param name="loop" value="false" />
        <param name="menu" value="false" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#336699" />
        <embed src="Chat.swf?ipaddress=10.0.55.106&port1=2000" loop="false" menu="false" quality="high" bgcolor="red" width="600" height="400" name="Chat" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </embed>
      </object></td>
    <td width="50%">&nbsp;</td>
  </tr>

0
 
LVL 27

Accepted Solution

by:
negatyve earned 520 total points
ID: 9656132
try it this way:

<object
      classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
      codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
      width="600" height="400" id="Chat" align="middle" >
        <param name="allowScriptAccess" value="sameDomain" />
      <param name="FlashVars" value="ipaddress=<%=System.Configuration.ConfigurationSettings.AppSettings["IPAddress"]%>&port1=<%=System.Configuration.ConfigurationSettings.AppSettings["PortNo"]%>" />
        <param name="movie" value="Chat.swf" />
        <param name="loop" value="false" />
        <param name="menu" value="false" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#336699" />
        <embed
            src="Chat.swf"
            FlashVars="ipaddress=<%=System.Configuration.ConfigurationSettings.AppSettings["IPAddress"]%>&port1=<%=System.Configuration.ConfigurationSettings.AppSettings["PortNo"]%>"
            loop="false"
            menu="false"
            quality="high"
            bgcolor="red"
            width="600"
            height="400"
            name="Chat"
            align="middle"
            allowscriptaccess="sameDomain"
            type="application/x-shockwave-flash"
            pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </embed>
</object>

if it doesn't work, just for test, change the:

<param name="allowScriptAccess" value="sameDomain" />

and

allowscriptaccess="sameDomain"

to

<param name="allowScriptAccess" value="always" />

and

allowscriptaccess="always"
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question