Communication with Files on different HTML Pages

I have a flex application that leads the user out of the
application in a new html window. When the user leaves the
application, a new flex application is embeded in the new page.
Once the new page is loaded, i want to to communicate the new swf
with the old swf app. When trying to communicate between the two I
get:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.LocalConnection was unable to invoke callback
completeSale. error=ReferenceError: Error #1069: Property
completeSale not found on flash.net.LocalConnection and there is no
default value.
For the sending swf file (the flash file), I have:
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" initialize="init()">
<mx:Script>
<![CDATA[
import flash.net.LocalConnection;
import mx.controls.Alert;
private function init():void {
var sending_lc:LocalConnection = new LocalConnection();
//sending_lc.connect('myCon');
try
sending_lc.connect('myCon');
catch (error:ArgumentError)
// server already created/connected
trace ("ERROR SENDING")
sending_lc.send('myCon', 'completeSale');
public function completeSale():void {
Alert.show ("SALE COMPLETE");
]]>
</mx:Script>
</mx:Application>
For the recieving swf file, I have:
import flash.net.LocalConnection;
public var recieve_lc:LocalConnection = new
LocalConnection();
public function init():void {
recieve_lc.connect('myCon');
recieve_lc.allowDomain("
http://localhost/");
//completeSale();
public function completeSale():void {
Alert.show ("SALE COMPLETE");
Init is called of course at the initialization of the app.
I have no problem communucating between two swf on a single
page, but can two swf on two different html pages communicate?
Thanks

hi
For this , you should try to use ExternalInterface instead of
localconnection, it's a new way to communicate between to swfs or
between felx and other languages such as javascript

Similar Messages

  • How to display a text file in a html page?

    I have written a servlet that executes a batch file whose output is saved to a txt file. I am attempting to display content of the text file as a html page from the servlet but am struggling I have attempted to read the file and output it as shown below but it is not displaying the correct data
    Appreciate some help
    Thanks in advance
    Amjad
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("C:\\Condor\\test\\QueStatus.bat");
    PrintWriter out;
    String title = "Que Status";
    response.setContentType("text/html");
    out = response.getWriter();
    FileReader fr = new FileReader ("C:\\Condor\\test\\output.txt");
    for (int chr = fr.read(); chr != -1; chr = fr.read()){
         out.print(chr);
    }

    Couple of things. First you should search the forums for how to properly exec a dos batch file. There are some problems you may run into especially with io. I suspect you may not actually be running that batch file at all.
    I would test outputing a text file separately from execing the batch file.
    Here is some code so you don't have to output 1 char at a time. Setting the content length and closing the output stream might help.
    File downloadFile = new File("c:\\blah\\blah\\blah");
    response.setContentLength((int)downloadFile.length());
    response.setContentType("text/html");
    ServletOutputStream out = response.getOutputStream();
    FileInputStream fis = new FileInputStream(downloadFile);
    byte[] buffer = new byte[1024];
    int bytesRead;
    while ((bytesRead = fis.read(buffer)) != -1) {
    out.write(buffer, 0, bytesRead);
    fis.close();
    out.close();

  • Vs 2013 community screws up formatting of html page when saving file

    I have seen other people having this issue with suggestions like 'Formatting and visualizations, tag specific options. However this is not solving my issue
    example
    I type the following code this way
    <asp:Panel ID="Panel1" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Days Old " />
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server">
    <asp:Label ID="Label2" runat="server" Text="Days Old " />
    </asp:Panel>
    then when I hit save the code changes to
    <asp:Panel ID="Panel1" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Days Old " />
    </asp:Panel><asp:Panel ID="Panel2" runat="server">
    <asp:Label ID="Label2" runat="server" Text="Days Old " />
    </asp:Panel>
    This messes with the outlining and makes it hard to see where controls like Panel2 is in the code.
    I am using a fresh install of visual studio community 2013 on a fresh install of windows 8.1 so this is not an issue with my istallation.
    I have tried setting tag Specific options with no change
    It doesn't do this every time or just on asp:panels
    I have tried adding line breaks and spaces etc. this doesn't help either.
    is this just a bug in visual studio or is there a general setting out of wack. I didn't have this problem with vs express for web 2012. but I did have it with vs express for web 2013 and community 2013

    Hi PBPuddin,
    Thank you for posting in MSDN forum.
    Based on your issue, I tried to add this code as you said into a html page and then I saved the code. I found that the code formatting of the html page did not occur like you said that in VS2013 Community.
    So to check if this issue is related to the VS2013 Community IDE, I suggest you could try to copy the  same version of the VS2013 Community setup file on other machine and then install it check this issue again.
    (1) If you still get the issue, I assume that the issue maybe related to this VS2013 Community setup file, so please download it from Microsoft official website and then install it again.
    https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx
    (2) If you did not get same issue, I suggest you could try the following suggestion to check the issue.
    (2.1) please try to open your VS in safe mode and then check if you install some add-ins in the VS IDE.
    https://msdn.microsoft.com/en-us/library/ms241278.aspx?f=255&MSPPError=-2147217396
    Or you could try to check if you install some third-party tool/ software on your machine.
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • FAQ: How do I embed my SWF file in an HTML page?

    Flash Pro creates HTML wrapper files for you when you use the File > Publish command, assuming you have the HTML Wrapper format selected in the Publish settings of your FLA file.
    However, these HTML wrapper files only contain the <Object> tag code to embed your SWF file. If you want to embed your SWF file in an existing HTML page that contains other elements, you can copy and paste the appropriate HTML code into the appropriate location within your existing HTML page. You can also use Dreamweaver to add the SWF file to the page.
    The TechNote Object tag syntax contains sample HTML code that you can copy and paste, along with instructions on how to edit the code to account for the actual name and location of your SWF file.

    Hi,
    You need to set the profile option 'Viewer:Text' to 'Browser'.
    Note: 160217.1 - How to Copy/Paste from a Concurrent Request Output
    Note: 184375.1 - How to Setup The Report Output to Different Viewer Types in Oracle Applications 11i
    Thanks,
    Hussein

  • How to run a jar file in a HTML page.

    Hi, i have created an applet that works with 2 or 3 classes, the i have done a Jar file and now i want to run the applet though a Html page, i have looked at many manuals and i have done the same as is said to create the Html file, but whe i want to see the page on the part of the applet nothing appears to me and when i go though the area of the applet with de mouse an error message apears saying that the clas XXXX (the main class of my applet) can't be instanced.
    Could someone tell me why is this? i need help or to see an example that works.
    Thanks

    Hi, i have created an applet that works with 2 or 3
    classes, the i have done a Jar file and now i want to
    run the applet though a Html page, i have looked at
    many manuals and i have done the same as is said to
    create the Html file, but whe i want to see the page
    on the part of the applet nothing appears to me and
    when i go though the area of the applet with de mouse
    an error message apears saying that the clas XXXX (the
    main class of my applet) can't be instanced.
    Could someone tell me why is this? i need help or to
    see an example that works.
    ThanksUse the archive parameter in the applet tag.
    e.g: <applet code="your_main_applet" width="256" height="256" archive="myjar.jar">
    Where myjar.jar is the actual jar file which contains all the user class files which are required to run this applet.
    For creation of jar files, please read the java tutorial in http://java.sun.com
    /Sreenivasa Kumar Majji.

  • Html link to multiple swf files on 1 html page

    i have a html page that has multiple (20) links to video files, i would like to play these files in the same position, within the same html page. therefore saving myself having 20 html files with the separate swf files embedded. firstly i was planning on converting my .mov files to swf to make then smaller.
    my query is, what is the best way to 'house' a swf file(s) that plays when clicked on the relative link on that page.
    i have build the page using CSS and have limited javascript knowledge although im keen to learn.
    cheers

    VIDEO GALLERY --
    You need a Flash player that supports a playlist.  If you're good with Flash and Action Script you could build a custom player.  If not, pick-one from the links below:
    Wimpy Rave simple to deploy, dirt simple to update playlists by uploading media to wimpy folder.
    WWD Player --
    http://www.woosterwebdesign.com/flvplayer/
    JW Player --
    http://www.longtailvideo.com/
    FlowPlayer --
    http://flowplayer.org/
    YouTube --
    http://code.google.com/apis/youtube/getting_started.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • JSP, downloading files and show html page

    I like to download files and show a html page on JSP.
    With the source following, downloading works well.
    But, it is just remained on the previous page, not showing the next html page.
    Someone tell me why is it?
    <%@ page import="java.io.*, java.net.URL"%><%
    String file_name = request.getParameter("file_name");
    File fileDir = new File(config.getServletContext().getRealPath("upload/"));
    File theFile = new File(fileDir, file_name);
    FileInputStream fin = new FileInputStream(theFile);
    response.setHeader("Content-Disposition","attachment; filename=\"" + theFile.getName()+"\"");
    response.setContentLength((int) theFile.length());
    BufferedInputStream bf = new BufferedInputStream(new FileInputStream(theFile), 8096);
    int i;
    while ((i=bf.read()) != -1)
    out.write(i);
    bf.close();
    out.close();
    %>
    <html>
    <head>
    <title>file download</title>
    </head>
    <body>
    <p align="center"> </p>
    <p align="center"><b><font face="Tahoma" color="#000000" size="2">You have
    successfully downloaded your file(<%=file_name%>)!</font></b></p>
    </body>
    </html>

    You's already close the JSP output stream befor you try and write your html confirmation, and I don't think browsers can provide the kind of functionality you're trying to demonstrate here. A browser will download the file and open it directly itself or using another application based on user input (e.g. save as, open file, etc.). Once the file is opened or downloaded, it's done!
    I think your best bet is to show a dialogue that the user's download should begin, then set the pages href w/ JS to the location of the file, same way other sites that allow you to download files do it. Go take a look at download.com or something like that.
    Hope that helps.

  • Unable to stream SMIL files unless the html page, swf file and the smil ffile are on the FMS server.

    When I place the .swf, smil and http files on the FMS server the SMIL stream test sample works fine
    But When I move the files to my web server I get Connection error.
    This is the same issue discussed in http://forums.adobe.com/thread/554107
    I added a ‘base’ variable but it did not work for me.
    The SMIL file has the correct path to the sample files and FMS server
         <meta base="rtmp://200.200.200.23/vod/" />
    I am able to stream files from my html file on my webserver not the FMS server by pointing to the FMS server at rtmp://200.200.200.23/vod/mp4:sample1_1500kbps.f4v
    Is this a domain security setting? If so, where do I change it?
    If not How do I get FMS to stream SMIL files without installing a webserver with FMS?
    Thanks,

    Hi,
    I think there is bug with that videoPlayer.swf which is used by index.html of webroot folder of FMS to play media files, its not able to parse smil file correctly. I used some other player and used the smil file and kept it on http server other than fms server so it was able to dynamically stream videos. So I would suggest you to create your own player which uses smil file. You can take help from the below link to create player:
    http://www.adobe.com/devnet/flashmediaserver/articles/dynstream_advanced_pt1_05.html
    Regards,
    Amit

  • Working with JEditorPane to display HTML page

    iam loading html page into JEditorPane .
    how to get the html form data to validate
    give me soluation for this problem ...
    thanks ....
    karthi

    Search for occurences of <img> tags in the stream and replace its src="" contents by for example src="image?id=orginatingimagefilenameorso" and write kind of an ImageServlet mapped on "/image*" which streams the right images to the response.
    You may find this ImageServlet example useful: http://balusc.blogspot.com/2007/04/imageservlet.html
    After all, why are you streaming HTML files through a servlet instead of just linking to them? Aren't they public accessible or so? If this is the case, consider creating a virtual host on the application server so that you can just access those files through a simple plain vanilla URL.

  • Please help!! Can I pass a variable between 2 swf's that are on different html pages?

    Hey,
    Does anyone know how to pass a variable (string) from one swf
    to another if there in separate html pages?
    I assume I’d have to send the variable from the first
    page and load it into the second but I don’t know what
    functions or code I should be using. Any suggestions would be a
    HUGE help.
    Thanks
    If it helps: I’m creating a log in and sign up sheet
    that can be accessed from several sites. I’d like to record
    which site the user has come from when they signup.
    Thanks

    if they are open at the same time (for the same user), you
    can use the localconnection class to communicate between the
    two.

  • Issue with templates and updating .html pages in my website

    Hello,
    I have taken over updating a website for the charity I work for. I have updated some eleements of the .dwt template page, however it does not seem to be updating the other .html pages for the website. I do not get the update pages box just a box saying 'You placed the editable region "breadcrumbs" inside a block tag. Users of this template will not be able to create new blocks in this region. Move the region outside the block tag if you want users to be able to do this" - I click OK and it saves the .dwt page, but does not update any other .html pages.

    I cannot answer your question(s), I have only hearsay experience, but I can offer some links on where to get information regarding Flash SEO...
    http://www.seobook.com/archives/001457.shtml
    http://www.flashseo.com/
    http://blog.searchenginewatch.com/090317-120653
    and the O'Reilly book: Search Engine Optimization for Flash by Todd Perkins, ISBN: 978-0-596-52252-0

  • Is it possible to stop the same swf button file from having to reload on different html pages

    Please view my website below. Any help would be appreciated. Each time you go to another page the buttons flash white while having to reload. Is there any way around this?
    http://www.kineticcreativeco.com/

    you could also try using the proper bgcolor parameters in your embed code and setting the color to black. this will most likely get rid of the white flash.
    here is some old sample code:
    <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="320"
         HEIGHT="240"
         id="slideshow">
    <PARAM NAME="movie" VALUE="slideshow.swf" />
    <PARAM NAME="quality" VALUE="high" />
    <PARAM NAME="bgcolor" VALUE="#000000" />
    <param name="allowScriptAccess" value="sameDomain" />
    <EMBED src="slideshow.swf"
         quality="high"
         bgcolor="#000000"
         WIDTH="320"
         HEIGHT="240"
         NAME="slideshow"
         allowScriptAccess="sameDomain"
         swLiveConnect="true"
         TYPE="application/x-shockwave-flash"
         PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
    </EMBED>
    </OBJECT>
    i would recommend: using swfObject instead and also putting all your buttons in one swf.

  • Problem with return link from html page back to css page

    Here is the site..almost ready for publication
    http://www.matriley.com/glensite/index.html
    1) Go to properties for sale
    2)Choose a suberb
    3)click on a property with a video
    4) watch the crazy video if you like
    5) Click go back to properties
    ^) Yes the page is there but the property page is now
    inactive...why?
    8)The whole thing works fine on Firefox but we do have this
    Glitch on IE
    PLEAASSE Can someone help
    Regards Matthew [email protected]
    Everything works well but for the problem return link to the
    properties page after you have gone to the video.The property page
    becomes inactive

    Your page is a monster -
    Empty Cache
    10.6K 1 HTML/Text
    1.5K 1 Stylesheet File
    985.4K 25 Images
    997.7K Total size
    27 HTTP requests
    25 images with aggregate weight of ~1MB is much too large,
    you know?
    Anyhow, I cannot reproduce your problem in IE7. Are you
    referring to IE6,
    instead?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "fredbillmatt" <[email protected]> wrote in
    message
    news:fv0m9k$a7a$[email protected]..
    > Here is the site..almost ready for publication
    >
    http://www.matriley.com/glensite/index.html
    >
    > 1) Go to properties for sale
    > 2)Choose a suberb
    > 3)click on a property with a video
    > 4) watch the crazy video if you like
    > 5) Click go back to properties
    > ^) Yes the page is there but the property page is now
    inactive...why?
    > 8)The whole thing works fine on Firefox but we do have
    this Glitch on IE
    > PLEAASSE Can someone help
    > Regards Matthew [email protected]
    > Everything works well but for the problem return link to
    the properties
    > page
    > after you have gone to the video.The property page
    becomes inactive
    >

  • FullScreenButton in SWF file in an HTML Page

    I have inserted a small video as a SWF file into my homepage along with Play, Pause, FullScreen and Mute buttons (loaded from the Flash Components panel). The Play, Pause and Mute buttons work fine. But when I click on the FullScreen Button nothing happens. It won't open the SWF video in a new page at full resolution. Any suggestions?

    your embedding html code must allow fullscreen.  if you let flash publish an html file for you and you change your publish settings to allow fullscreen, you'll see what's needed.

  • How to add a video file into an html page

    I would like to add a Quick Time video into a website that i am currently coding for a school project. I have the video file on my hard drive, so I'm not trying to embed it from YouTube. I have tried several ways of placing the video into my webpage, but all I can hear is the sound from it, there is no visual to go with it. Does anyone know how I would go about placing the file into my webpage, or what code I would need to use? I'm using Dreamweaver CS4 and, once again, the video is a Quick Time file.
    Thanks in advance.

    QuickTime requires player and plugins that most people don't have.  You'll reach a much wider audience if you use HTML5 <video> with mp4, webm and ogg files.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Video</title>
    <!--help for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <style>
    video {
        max-width:100%;
        display:block;
        margin:0 auto;
    </style>
    <body>
    <h2>Use 3 File Types to support all browsers &amp; mobile devices:  MP4, WEBM and OGV.</h2>
    <h3>Online Video Converter
    http://video.online-convert.com/</h3>
    <!--begin video-->
    <video controls poster="Your_poster_image.jpg">
    <!--these are 6 sec sample videos for testing purposes. Replace sample-videos with your own files-->
    <source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
    <source src="http://techslides.com/demos/sample-videos/small.ogv" type="video/ogg">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
    If you're seeing this, you're using an
    outdated browser that doesn't support
    the video tag. </video>
    <!--end video-->
    </body>
    </html>
    Nancy O.

Maybe you are looking for

  • 10.4.7 and Safari lock ups - Any ideas please?

    Hi all, I installed the 10.4.7, iTunes and Quicktime updates and have found Safari to be freezing (not responding) on random sites. I did get an odd message on the first attempt of downloading, which I have never seen before - 'Download timed out' -

  • Interactive report for vendorwise purchase order details

    Hi Experts,   I am trying to create vendor wise purchase order interactive report, if  i click any of vendor detail it has to call display vendor screen for selected vendor or if i click any of purchase details it has to open purchase order details..

  • Templates with motion menus flicker

    I have Encore CS6. If I use any of the templates from the library there is a very noticeable around the text on the menu. It's irritating to the point that I cannot use motion menus at all.

  • Vendor Account in FB60

    Hi, My client is asking when they are watching GL line items display the vendor account field is blank for document type KR. And these KR invoices are posted in TCode FB60. But I saw that there is no field to put vendor account while entering the tra

  • 32HL933 - no sound in PC mode using VGA cable

    I have a problem with connecting a computer to TV (32HL933). I plug the VGA cable view is fine, but I can not connect the sound... Where TV takes an audio signal in PC mode?? (in this TV model)