Control/unload swf inside html textfield i AS3

Hi,
In a CS3/As3 project I have xml files with html content loaded in a texfiled inside a mc. In some cases I have swf files embedded with img tag in the xml. The problem is that when a swf is loaded this way It keeps 'living', playing with sounds in the background when other xml files and swf are loaded in the texfiled.
Then, every time it is loaded, a new instance of the swf is created and played.
I have found out you can refer to the loader object with getImageReference method giving an id to img tag and, for example, adding an Event.COMPLETE listener to the loader.
But I don't know how to access to the loaded swf to unload it or at least stop it (mc_name.texfiled_name.swf_id doesn't seem to work in AS3)
Does anybody know if it is possible?
Thanks in advance

Thank you, the second method is good to control movieclip in my case (fp9).
But I have still the following problem: the loaded objects (swf or images) seem to remain in memory.
I have a loader like this (swf_Id is the id of img tag)
loader = myMC.MyHtmlTextField.getImageReference("swf_Id");
and, following your indication, a second Mc like this
myMC2=MovieClip(loader.content);
doing the following things seem to remove the objects from stage but with no effects on the memory wich always increases
myMC2.removeChildAt(0);
myMC2=null;
loader.unload();
Any idea about this?
Thanks a lot!

Similar Messages

  • Fscommand when the swf inside html  table

    in the html file , when I put the swf file inside a table,
    the fscommands does not work.
    how do i make it work?
    should i make any changes in the html? ?
    notice: when the swf is out side the table , it is working
    fine.

    Found the solution to the problem.
    wrapped the entire HTML page till the JSF component ( panelGrid) under <f:verbatim>.
    something like this
    <f:verbatim>
    <table>
    <tr> <td>...</td>
    <td>
    </f:verbatim>
    <h:panelGrid> ... </h:panelGrid>
    <f:verbatim>
    </td>
    </table>
    </f:verbatim>

  • Placing Flex SWF inside HTML?

    We're building a website that will incorporate a flex
    gallery. We would like to house this inside of HTML on the page. Is
    this possible? Would it be as simple as calling a regular flash (in
    this case, flex) movie, or is it more complex? We dont want it to
    take up the entire window, but only a portion, inside of a
    template. Thanks!
    Ryan

    As JabbyPanda says, yes, In fact it is rare to find a Flex
    app that is not contained in an html page. Flex builder generates
    this wrapper for us automatically.
    In an Flex only app, the object/embed tag is just set to take
    up the whole browser.
    Tracy

  • Scrollbar missing. Help me bring it back please (swf inside HTML)

    I published a swf file with the html wrapper.
    Flash publish settings were-
    Size - %
    Height- 100%
    Width 100%
    Scale- No scale
    HTML alignment- Default
    Flash horizontal alignment- Center
    Flash vertical alignment- Center
    All good but there are no scroll bars on the browser when I make the browser window smaller? Search took me to this thread-
    http://forums.adobe.com/message/3557607
    The solution there is "find the parameter in your CSS that states "overflow: auto" or "overflow: hidden" and change it to "overflow: scroll"
    I did that and now I see a white scroll track in the browser but no actual scroll bar wehn I resize the window? LOL What do you think is going on? How do I solve this problem? I am a NOOB!
    Thanks
    This is theFlash generated code-
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
            <title>TEST</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <style type="text/css" media="screen">
            html, body { height:100%; background-color: #333333;}
            body {
        margin:0;
        padding:0;
        overflow:scroll;
            #flashContent { width:100%; height:100%; }
            </style>
        </head>
        <body>
            <div id="flashContent">
                <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="TEST" align="middle">
                    <param name="movie" value="TEST.swf" />
                    <param name="quality" value="best" />
                    <param name="bgcolor" value="#333333" />
                    <param name="play" value="true" />
                    <param name="loop" value="true" />
                    <param name="wmode" value="window" />
                    <param name="scale" value="noscale" />
                    <param name="menu" value="false" />
                    <param name="devicefont" value="false" />
                    <param name="salign" value="" />
                    <param name="allowScriptAccess" value="sameDomain" />
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="TEST.swf" width="100%" height="100%">
                        <param name="movie" value="TEST.swf" />
                        <param name="quality" value="best" />
                        <param name="bgcolor" value="#333333" />
                        <param name="play" value="true" />
                        <param name="loop" value="true" />
                        <param name="wmode" value="window" />
                        <param name="scale" value="noscale" />
                        <param name="menu" value="false" />
                        <param name="devicefont" value="false" />
                        <param name="salign" value="" />
                        <param name="allowScriptAccess" value="sameDomain" />
                    <!--<![endif]-->
                        <a href="http://www.adobe.com/go/getflash">
                            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.g if" alt="Get Adobe Flash player" />
                        </a>
                    <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
            </div>
        </body>
    </html>

    Well....
    - I get a full white page with no test.swf file in it when using firefox.
    - In Safari (PC) I see the full swf. I see Safari browser scroll bar but it is the length of the whole browser. When I reduce the size of the browser the scrollbar can't be scrolled as it remains 100% long.
    - In IE I see complete white page but a horizontal band at the top showing small section of the test.swf.
    Here is how it looks after the edit-
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
            <title>test</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
        * { margin:0; padding:0; }
        html { overflow-y: scroll; }
        body { zoom: 1; }
        </style>
        </head>
        <body>
            <div id="flashContent">
                <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="test" align="middle">
                    <param name="movie" value="test.swf" />
                    <param name="quality" value="best" />
                    <param name="bgcolor" value="#333333" />
                    <param name="play" value="true" />
                    <param name="loop" value="true" />
                    <param name="wmode" value="window" />
                    <param name="scale" value="noscale" />
                    <param name="menu" value="false" />
                    <param name="devicefont" value="false" />
                    <param name="salign" value="" />
                    <param name="allowScriptAccess" value="sameDomain" />
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="test.swf" width="100%" height="100%">
                        <param name="movie" value="test.swf" />
                        <param name="quality" value="best" />
                        <param name="bgcolor" value="#333333" />
                        <param name="play" value="true" />
                        <param name="loop" value="true" />
                        <param name="wmode" value="window" />
                        <param name="scale" value="noscale" />
                        <param name="menu" value="false" />
                        <param name="devicefont" value="false" />
                        <param name="salign" value="" />
                        <param name="allowScriptAccess" value="sameDomain" />
                    <!--<![endif]-->
                        <a href="http://www.adobe.com/go/getflash">
                            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                        </a>
                    <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
            </div>
        </body>
    </html>

  • Controlling loaded SWF inside a child

    Hello to everyone, may this question be too obvious to
    everyone, but I've been googling for hours without any luck.
    Have seen examples but they are not exactly as my scenario...
    Please, I need some help.
    I have loaded a SWF and attached to a MovieClip which exist
    in my current movie using the following code, and now I just want
    to access the loaded SWF to send it orders like play() or
    gotoAndPlay(); I have tried also: container=
    MocieClip(loader.content); instead adding child, but it trhows an
    error

    //this is your minimum code to load a file
    var url:String = "put your url here ";
    var request:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.load(request);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    loadComplete);
    function loadComplete(event:Event):void {
    addChild(loader.content);
    //you don't need all that code just concentrate on the bit
    you need; when this work then you can start putting the rest

  • AS3 SWF inside Director 11.5.9 quirk

    I've previously used AS2 SWFs inside Director 11.5.9, and the SWFs work fine, actionscript works as it should.
    I'm working on a project where I need to use some AS3 SWFs inside Director, and I've come across a limit on the pixel width and height of the SWF. It seems that if either the pixel width or height of the published SWF are greater than 1638, then any actionscript inside the SWF is ignored when the SWF is loaded into director. The SWF still works ok outside of Director.
    For example, any actionscript stop(); commands are ignored and the playback continuously loops through the swf timeline.
    Has anyone come across this before?
    I am almost 100% certain this issue is related to the pixel width / height, as I've made a simple button navigation swf, and published it with different stage sizes. 1638 or less work inside Director, 1639 or more don't work inside Director!

    Made me laugh until I cried...
    Or did I just cry? :(
    Cruel but funny!
    Richard

  • Loading a SWF inside another SWF question

    Hello friends,
    1. (IMPORTANT) As all we know when putting some Flash SWF
    inside an HTML page, normally it starts playing as soon as its
    first frame is loaded.
    Now in my case I have to load a SWF (let call it Flash A)
    inside another Flash, I used mx.controls.Loader control to do this.
    But this internal loaded SWF (Flash A) doesn't display untill it is
    completely loaded. Although what is interesting is that if it
    contains a sound track I can hear it while it is being loaded.
    I wana know is there any way that we can make this Flash
    display while being still loaded.
    2. Is there anyway to change a Flash playback FPS at runtime?
    Thank you so much for any note and help.
    - M

    damatrixhasu wrote:
    > i want to know how i can load a flash inside another
    flash container
    go to help - search for 'loadmovie'
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Flash-html-textfield / links in a MIAW?

    Hello folks,
    i have a problem that freaks me up:
    SETUP:
    within a director-movie (main movie) i load a second
    director-movie as MIAW (second movie). within the second movie i
    have a swf-sprite (swf movie) that contains a html-textfield.
    now i try to pass a html-string to that textfield, for
    example:
    ... see below ... ;)
    if i preview the swf-movie, that works fine.
    PROBLEM:
    within the director-movies this html-string is only
    interpreted as string, no link is available... the textfield
    displays only GOOGLE - no matter if or how " / ' is escaped ... can
    anybody hint me to a solution of this problem?!

    Flash normally runs in a browser window, and so its native
    mechanism for
    interpreting a call to the web is to send out to the browser
    to make
    this happen.
    When you place a Flash .swf inside a Director movie, either
    by importing
    or by linking the .swf, the Director movie is now the host
    for that
    file, not a browser window. While Director is fully capable
    of opening
    the new link in a browser, it doesn't understand the command
    that Flash
    is sending to it.
    What you need to do in this case is to pass the url to the
    Director
    movie and let it open the browser connection.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • Call Flex swf inside extension object

    Hi,
    I am building a user application using Flex 3.  The application allows user to input information using input components such as text areas, etc.  The application will create an xml file from user info.  The application needs to save xml file in user's local hard drive.  For user convenience, we want to be able to call the application from inside a DW menu.  This requires an extension which implies installing an mxp.  To avoid multiple installs, we want to deliver the application inside the extension.  This involves creating an extension object that has my Flex app embedded in it.  I have been able to create the extension object, have it show up in my insert bar, and deliver my Flex swf inside the extension.  However, when I type inside a text area in my swf, I am not able to.  It acts as if disabled.  I explicitly set my text area as editable=true and enabled=true.  Why?  Here is my extension:
    <html>
    <head>
    <title>WBT Ouline Tool</title>
    <style>
    body { margin: 0px; overflow:hidden }
    </style>
    <script language="javascript" type="text/javascript">
    function createTextFile(textItem) {
      //future code to create xml file will go here.
      //it will use DW FILE I/O APIs
    </script>
    </head>
    <body>
    <form>
       <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
       id="wbtOutline" width="406" height="276"
       codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
       <param name="flashvars" value="bridgeName=wbtOutlinePanel"/>
                <param name="movie" value="wbtOutline.swf" />
       <param name="quality" value="high" />
       <param name="bgcolor" value="#869ca7" />
       <param name="allowScriptAccess" value="always" />
       <embed src="wbtOutline.swf" quality="high" bgcolor="#869ca7"
        width="406" height="276" name="wbtOutline" align="middle"
        flashvars="bridgeName=wbtOutlinePanel"
                    play="true"
        loop="false"
        quality="high"
        allowScriptAccess="always"
        type="application/x-shockwave-flash"
        pluginspage="http://www.adobe.com/go/getflashplayer">
       </embed>
    </object>
    </form>
    </body>
    </html>

    Do you know where I can find examples on how to use dreamweaver.flash.newControl()?
    I am still having no luck.  My control shows up but can not interact with it and external interface not available.

  • .swf inside HtmlLoader appears on top of other air content

    When there is an HtmlLoader with a .swf wmode window the .swf file appears over top of everything!
    I understand that .swf should appear above everything inside the HtmlLoader, but I don't think it should appear over top of anything outside of the HtmlLoader.
    A simple example of this would be:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx">
    <mx:HTML location="http://youtube.com" width="100%" height="100%" />
    <s:Button width="300" height="300" label="should be over all html content, .swf in html appears over it. click and watch a youtube video to see." />
    </s:WindowedApplication>
    I NEED a fix to this~!
    Even placing a second HtmlLoader with an .swf wmode window over top produces random results with the top .swf sometimes on top and other times below the lower .swf

    As you have discovered, two elements on the surface of a <div> cannot occupy the same space. The solution lies in getting one of the elements to "lie down," either by getting it totally off the surface and making it a background of it or by actually "levitating" one above the other.
    Apply a unique id to each div in which an image now lies.
    Place each image in the background of its div, defining it in your CSS.
    You will not then be able to use the image as a button, and you may want to add something else to click on.
    OR (this second way is probably better)
    Change the .FilmStill definition by adding position: relative;
    Change the .SlantedWritingFilms definition by adding position: absolute; and positioning attributes (left: 0; top: 0; for instance)
    Change each .SlantedWritingFilms <span> into a <div> within <div class="FilmStill">.
    Beth

  • Embedding swf into HTML+JS AIR app

    Hi
    I'm trying to embed swf into HTML+JS AIR app with no luck.
    First, I created flash library with this class in default package.
    package
         import mx.controls.Alert;
         public class Utilities
              public function Utilities()
                             //asdfasdf              
                   Alert.show("asdasd","");
    Then I compiled the project with Flash Builder and got library.swc as result. Then I extracted swf file.
    After this is added required code into my html:
    <html>
    <head>
        <script type="text/javascript" src="AIRAliases.js"></script>
        <script type="text/javascript" src="AIRIntrospector.js"></script>
        <script type="text/javascript" src="jquery-1.6.2.js"></script>
        <script src="library.swf" type="application/x-shockwave-flash"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                alert('loaded');
                air.Introspector.logError("aaa");
                var v = new runtime.Utilities();
        </script>
    </head>
    <body>
    </body>
    </html>
    Then after I run application, I get error that result of expression is not constructor, function etc.
    Could you help me please?  Thanks in advance.
    Here is sample code:
    http://depositfiles.com/files/jztpnlb3a

    No. I mean that the Flex framework makes certain assumptions about the environment it is running in -- like having a stage to work with. The Alert function, for example, works by creating a sprite and adding it to the Flash display list. Since your embedded SWF is not on a stage, there's no way for it to work.
    You can can possibly use certain non-visual parts of the framework, such as the rpc package, but I can't guarantee it.

  • Loading and unloading swf

    I am making a site and I want each button to load an swf,
    which would be the content of each page. When I click on each
    button the swf will load, however, the old swf will not go away.
    how does one do this. Thanks.

    It looks like you are adding the newly loaded swf, but not
    removing the old one. So, maybe this change would help:
    function about_CLICK(myevent:MouseEvent):void{
    var loadMain:Loader = new Loader();
    loadMain.load(new URLRequest("clip0.swf"));
    // if there is a child on the display list remove it
    if (getChildAt(0) !=null) removeChildAt(0);
    stage.addChild(loadMain);
    I should mention, however, that there is a bug in Flash 9
    related to unloading swfs:
    http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html
    However, I don't think this is affecting your visible
    behavior.

  • Flash CC does not publish swf and html files

    I'm having issues with Flash CC. When I go to publish my movie the status bar appeaers then quickly disappears and the html and swf files are not created. I'm also not able to export the movie as a quicktime or AVI file. Is there specific settings I must have to publish and export? Note: I am working with AS3 and tried to do a simpple test with a box moving left to right and I have the same problem.
    Any help is appreciated. Thanks!

    Are you sure the HTML and SWF are not currently in use? For example if you publish and preview it in a browser, it can lock those files because they're "in use". Then Flash cannot overwrite them. You'd need to close the browser or any Flash Players displaying them. If that still won't overwrite, delete the files and see if they're re-created.
    If no files are being created at all, gointo publish settings and set a path to export the SWF and HTML file to, don't leaving it at the default (same folder as FLA). Try various places in fact to test permissions.
    If you're on Windows you could try running Flash CC as Administrator to also get around any file writing permission issues. Right-click on the Flash icon and select Run as Administrator.
    I've only really encountered this when my SWF/HTML was in use or stuck in a process.

  • SWF and HTML won't play stand alone

    My .swf and.html files won't play on their own even with
    latest Flash player installed (flash player 9). The html will play
    if right clicked and internet explorer is selected manually, but
    not on its own. Both files will play on their on when on a computer
    with Flash installed. I finished the project and published them
    using Flash 8, what's going on? I didn't see anything in the
    release notes. Anyone have an idea or had this problem?
    Thanks!

    Looks to me like the issue is indeed your CMS. The flash content is loaded in a lightbox, which is most likely controlled by some JavaScript or ASP. My guess would be that the problem lies with the paths to the files. The swf file that the lightbox loads is referenced in your CMS so it knows where to get it - the thing is that most likely it is not played from the location where it's located but instead played from the location where the lightbox script is loaded. Since the 4 SWF's you have are not located there it won't be able to find it.
    Also this lightbox approach isn't very good for this type of content. The demo is extremely small and the alignment of the Flash file looks weird. Instead just use the HTML file generated by Captivate and upload that to a directory in your CMS. Then change the link you have so it opens the HTML file in a new window and everything should work out just fine.
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • Control a swf via RF remote control, ala Powerpoint?

    Hi
    I am in the middle of a Flash project creating a powerpoint
    like
    presentation to be shown on a projector screen. Flash 9 or a
    projector.exe
    I wonder have you ever had to ask Flash/Flex to control the
    remote clicker(pointer) buttons using a Front Projection screen ???
    I looked on Adobe, Forums and found only this entry,
    Topic Title::: How can I control a swf file via RF remote
    control, ala Powerpoint?
    - but don't seem to be able to get to work.
    Is there a new method used in AS3? I really need to get my
    hands on a very simple .flv example.
    I need to click to the nest stop(); and click back if needed.
    onKeypress pagedown
    onKeypress pageup
    Thankyou

    I figured it out. Just make a full-screen invisible button
    and place it on a layer on each frame.
    For insatnce, Actions - Button for frame 2:
    on (keyPress "<PageDown>") {
    gotoAndStop (3);
    on (keyPress "<PageUp>") {
    gotoAndStop (2);
    sends the show forward to frame (slide) 3 with a press of the
    remote's "Next" button and sends it back to frame (slide) 1 with a
    press of the "Back" button.
    I have a Stop action on each frame.
    This allows me to control a Flash show just like a Powerpoint
    show. Cool.

Maybe you are looking for

  • Rendering Error when using more than one DataSheetView on a Enterprise Wiki-Page

    Hi Experts, how to reproduce: Add two Custom Lists with some Fields (Add Lookup-Columns to both Lists). Add a DataSheetView to each List and mark it as Default-View Create a Enterprise Wiki-Page Add a WebPart (Custom-List-1) You will see the Content

  • About migrating from 10.1.2 to 10.1.3 (page events)

    Hi forum, As authentication based on public key certificates only works under jdev 10.1.3.1, I'm upgrading my 10.1.2 application to that version. I'm following the Oracle document "Converting to the ADF Page Lifecycle from 10.1.2" (http://www.oracle.

  • Windows7 no longer sees iphone as a device

    I just installed ios 7.0.6 and I can no longer see the iphone as a device on a windows 7 computer, in order to transfer pictures from the iphone to my computer.  I used to be able to see it when opening up my computer and I would also get the autopla

  • Select Column using Session Variable

    I have set a session variable to hold the name of a column dependent on who the user is. Is it possible to use a session variable to select a column in a database table? If so, how? Does it need a where statement? Something like this?: <cfquery name=

  • Trouble backing up ipad - getting apps from other ipad

    I am backing up my ipad and my daughter's ipad (no family sharing set up when this happened) and she has her own apple id. Both ipads backed up to the same itunes account. I back up her ipad and it automatically downloads apps from the itunes which a