Embedding swf in container on page load

I'm trying to figure out what the AS3 script is to have a swf embedded inside of a container, little new to AS3. any help? Thanks.

There is nothing wrong with that code unless you have some object on the stage with the instance name "sliderCont" that you are expecting to have the swf load into.  The code creates a loader instance named "sliderCont" and loads an swf into it, and then adds that loader to the display list.
If "sliderCont" is some other object, then you need to pick a different name for your loader and then add the loader as a child of that.
var ldr:Loader = new Loader();
ldr.load(new URLRequest("flash-xml3.swf"));
sliderCont.addChild(ldr);

Similar Messages

  • Embedding video in a dinamic page loaded using ajax

    I've been trying to do this for some days now, and still couldnt find a solution.. this is the story:
    I need to embed a movie (.mov, mp4, m4v) in a dynamic page loaded by an ajax call, i followed the recommendations specified in apple's page so i can monitor progress, and listen DOM events:
    QuickTime and JavaScript
    on Firefox, everything works very well, i can monitor progress, listen events, etc.. etc... (this app is intended to be multi browser)
    On the contrary, IE is driving me crazy, it does not do anything.
    So to debug this i did the following (for IE):
    i tried then, creating a simple STATIC page in my computer, that loads the movie, and listens to its events, it worked good.
    Then i put that html file in a web server, and every "first time" that i open the page, it wont work at all. After a reload, it will work good.
    Then i created a simple page with an ajax call that will insert the html embedding the movie, and again it wont work in IE.
    I want to be able to listen DOM events in IE in a dynamic page
    Please help me with this.
    <Edited by Moderator>

    I've been fighting this last couple days as well.
    Somehow the dom events are not fired
    –in win explorer that is– when the movie is
    inserted after the document loaded.
    I've been trying many variation to get it to
    work and just found a hackish way:
    After you have added the movie via javascript
    use the movie.SetURL('/movie.mov') function
    and then the RegisterListener() function.
    This enabled the Dom event for me.
    Additionally you can use
    movie.SetResetPropertiesOnReload(false) to
    keep the movie properties.
    function insertMov() {
    var embtxt = QTGenerateOBJECTTextXHTML("../movies/main.mov",
    477,
    268,
    'obj#id', 'mainobjId12',
    'emb#id', 'mainembId12',
    'emb#name', 'mainembName12',
    'EnableJavaScript', 'True',
    'postdomevents', 'True',
    'autoplay', 'False',
    'controller', 'False'
    var mov_container = document.getElementById('mov_container');
    mov_container.innerHTML= embtxt;
    setTimeout('reg()',100);
    function reg(){
    document.getElementById('mainobjId12').SetResetPropertiesOnReload(false)
    document.getElementById('mainobjId12').SetURL("../movies/main.mov");
    RegisterListener('qt_canplaythrough', 'mainobjId12', 'mainembId12', aallrrtt);
    function aallrrtt(){
    alert('qt_canplaythrough');
    }

  • Embedded SWF flashes white before it loads.

    I have an SWF embedded in a table. When it loads in the
    browser the SWF briefly flashes white before the preloader begins
    to load. I have set the color properties in both the SWF file and
    in the table cell. Is there a way to change the color from white to
    another color?

    Thanks for your help, but I already figured it out. Here is
    the code:
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    width="79" height="427">
    <param name="movie" value="assets/swf/thmbs.swf" />
    <param name="quality" value="high" />
    <embed src="assets/swf/thmbs.swf" width="79" height="427"
    quality="high" pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash"
    bgcolor="#4B4B4D"></embed>
    </object>
    I had to add a "bgcolor" to the "embed" tag. Note, for some
    reason this will overwrite the background color that is set in the
    SWF in Firefox.
    Thanks again!
    Thanks again!

  • Embedding .swf file into web pages

    What's the best way of embedding a flash file into web pages?
    After Microsoft introduce something about the active object (need
    to click on the Flash file first on IE to activate it) it seems
    like the best way is to use 'FlashObject'. Is there any other
    better way? Thanks a lot.

    SWFObject, which
    used to be FlashObject.

  • Randomly load swf on html page load

    I am looking for a way to load random swf files on a page
    load.
    I will have 1.swf, 2.swf, 3.swf, and so on. I want my html to
    reference "randomnumber().swf" when it loads (or something like
    it). Any simple ways to do this? I'm a newb, so the more detail the
    better.
    Thanks in advance.

    I must be doing something wrong. First time I have ever
    messed with project.
    I created a new project and over in the project window I
    right-clicked and chose "Add File" and added my swf files. I went
    to INSERT | NEW SYMBOL and created a movie clip called mc0. I
    couldn't find where to change its position, so I tried CTRL-K on it
    and tried different alignments on the stage (I don't think that
    worked very well). I didn't know if you wanted the code on the
    first frame of the movie clip or the main timeline. Based on the
    code I thought the main timeline, but I put it in both just in
    case.
    Doesn't seem to work for me. Can someone fill in the gaps for
    me?

  • Cannot see embedded swf's in html

    When creating my flash file, i load swf files into loaders on my stage. When testing it, it works fine, but when publishing it to the web, it dosn't show the embedded swf's?

    I'm assuming you intend that the embedded swf is the one that loads the other swfs... the one that is coded into the html page, not the ones that are loaded into loaders.  Did you upload the AC_RunActiveContent.js file that Flash creates?

  • Need help with embedded SWF in PDF as navigation

    Hi,
    I was wondering is there a way to have an embedded swf navigate to different pages of a pdf?
    Example:
    My swf is on page one. There are mulitple buttons in the swf, when clicked it will take you to page 3, or 5, or 7, etc.
    Currently, when I click on a button, it DOES take me to say page 4, but the content on page is the SWF file from page 1, and not the content that is suppose to be on page 4. Has anyone else experienced this problem?
    This is what I have in the flash action:
    btn_1994_1.addEventListener( MouseEvent.CLICK, p1994 );
    function p1994(e:MouseEvent):void{
         //addChild(pop_1994);
         doExternalInterfaceCall("gotoTarget", "pink");
    function doExternalInterfaceCall(myfncall, parm)
        flash.external.ExternalInterface.call(myfncall,parm);
    And this is what I have in the javascript of the pdf:
    function gotoTarget(name)
         this.gotoNamedDest(name);
    Please help me fix this problem.
    Thanks in advanced!
    ps. I am using Acrobat 9 Pro

    can anyone help?

  • Need to rotate a swf on page load???

    Not sure if this is the place to ask this but I have a swf file embeded in a web page design.
    Now here’s the issue, the client wants to add more photos to it making it even larger.
    I would prefer not to make it larger but create 2 or 3 swf files that would randomly load when the webpage is refreshed or reloaded.
    Is there a way to code a random swf loading in HTML?
    Would I use javascript? I googled and found nothing on the subject.
    Thank you

    Would you recommend php or javascript to achieve my goal. 
    I think that depends on your site and your comfort level with code.  If you're building  .php pages, use PHP scripts.  If your building .htm or .html pages, JavaScript might be a better choice.
    Sadly, my Twitter account is not exactly a hot bed of activity.  I'll try to make an effort to post some things of interest once in a while.  :-)
    Cheers,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • ADF Regions - Embedding region pagedef & Page load

    Hi,
    I'm working with regions in JDev 10.1.3.2. The problem I'm having is this: I have a page that uses a region with its own pagedef. So, I added a <page> element in the parent page's pagedef referencing the pagedef of the region and set the 'value' attribute in the <af:region> tag to the page element in the binding container.
    So far so good, the inclusion of the pagedef works fine. The thing is that the region has some "On page load" behavior, implemented following one of Steve Muench's not yet documented apps. In the pagedef of the region I specify the 'ControllerClass' attribute to a backing bean with an EL. If I run the page every thing is rendered but an error appears saying "Missing class #{...}" and therefore the onPageLoad behavior is not executed. If I specify the ControllerClass with the fully qualified name of the class a "ClassCastException" is thrown.
    If I run the page as a stand-alone jsp it works fine, the problem must have something to do with the whole pagedef embedding business...
    Any help or insight is appreciated.
    Thanks,
    Yoel

    Third repost.
    I'm starting to get the feeling that I'm being completely and utterly ignored. Either I didn't explain the problem well or the problem isn't solvable. I just want anyone, and I mean anyone at all to tell me:
    a) "The problem has no solution, wait for the production release of JDev 11"
    b) "I'm having the same problem"
    c) "We are working on it"
    d) "Please don't ask anything else about regions, we released them without proper testing. So some things are going to work and the others may work or not."
    Yoel

  • Embedded .swf's calling javascript from air container

    1) I have an html/ajax air app version 1.5.1
    2) This air app embeds .swf files from an external source / web server & plays the embdded .swf inside air.
    3) The embedded .swf file has a button with an onClick event
    function onClick(event:MouseEvent):void {
    ExternalInterface.call("someJavascriptMethod()" );
    4) The javascript method to be called is already parsed inside the containing Air app and is waiting to be triggered.
    5) When the onClick is triggered, the following error is thrown.
    Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX,
    Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
    at Error$/throwError()
    at flash.external::ExternalInterface$/call()
    at stress_fla::MainTimeline/onClick()
    6) On investigation I found on your livedoc's website that Air does not support the ExternalInterface.call method.
    http://livedocs.adobe.com/labs/air/1/aslr/flash/external/ExternalInterface.html
    Look for Note: Adobe AIR currently does not support the ExternalInterface class.
    7) Does anyone here know how I can get an embbeded .swf file to call javascript methods in the containing air application? I have had a look at the getUrl method but this is now longer supported & even the FS command but still to no avail. I may have a work around by inserting a DOM element over the top of the embedded .swf but this is not an elegant solution & want the .swf to talk directly to the air app container.
    All help & comments welcome
    Thanks
    Kyle
    Additionally I have found
    http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7ed4 .html
    Using the Html Loader so that Actionscript can call/manipulate the dom objects. At first I was whopee but then I tried the examples listed in the help. The HTMLLoader class is only available in Air. When trying to use import flash.html.HTMLLoader; Flash C4 complains that the Definition cannot be found on compile time & therefore does not export my movie correctly. Has anyone else had this problem or have a solution??
    More additions:
    The reason the htmlLoader class was not compiling was due to the source action script provided being ActionScript 2.0 - the htmlLoader class is a 3.0 library.
    However, after more investigation I have found the current structure.
    The air app has an html base/root doc. On periodic javascript events - .swf files are downloaded via
    videos = new air.Loader();
    netStream     = new air.URLRequest(path + file);
    videos.load(netStream);
    So now I have a html container in my air app that creates a new air.Loader which downloads the external .swf file in which I want an onClick event in the action Script of the downloaded .swf file to call a Javascript method of the parent air container. Simple yea?
    Or am I making life to hard for myself? Have been looking at the security snadboxes but I don't see how I can get the .swf file to talk nicely with the outer air container. Please help if able.
    Thanks
    Kyle

    Hi Kenneth,
    Your explanation makes sense.
    I have a big JavaScript file full of special mathematical functions written by a mathematician who only knows how to program in Javascript.
    I need to call the Javascript functions from within an ActionScript library, which obviously has no UI, and thus HTML and/or HTMLLoader are not an option.
    Any ideas?
    TIA,
    mlavie

  • Crash to desktop when loading embedded swf

    I have a swf that loads two other embedded swfs. The need for an air native extension came up so I've wrapped this swf inside of an AIR app. I install my app as a native installer. (on Windows 7)
    My app has a main menu screen and two buttons that will load two separate swfs to do their own menus and actions.
    Everything has worked great, until I tried to install the AIR app on a computer without internet. I ran the air redistributable, then installed my app. The main menu runs fine, and the main swf can load one of the embedded swfs, but when it tries to load the second embedded swf it crashes to desktop. No warnings, no errors, I just see desktop after clicking a button.
    Here is how I'm loading the offending swf:
    Inside MM_DocumentClass.as
    [Embed(source="../../ContentViewer/bin/ContentViewer.swf")]
            public var CViewSwfClass:Class;
            public var CViewMC:MovieClip;
    Inside MMState_MainMenu.as
         //Load the CView.swf, and add the listener for when it's done loading.
            public function CView_BtnClick(e:Event)
                Globals.stage.removeEventListener(KeyboardEvent.KEY_DOWN, Globals.keyPressHandler);
                menuMC.removeEventListener("Animation_Complete", CView_BtnClick);
                trace(this + "******************************************************");
                trace(this + "Loading ContentView.swf");
                mStateManager.Container.CViewMC = new mStateManager.Container.CViewSwfClass();
                mStateManager.Container.CViewMC.addEventListener(Event.COMPLETE, onCviewLoad);
                mStateManager.ChangeState(new MMState_Empty());
            //Called when CView.swf is done loading
            private function onCviewLoad(e:Event)
                trace(this + "Cview Loaded");
                mStateManager.Container.addChild(mStateManager.Container.CViewMC);
    I load the other swf in the exact same way.
    This problem can be fixed by connecting the computer to internet and trying to run the same actions. The program will pause for a second, during this time I see a visible loading icon in the middle of the screen, then it successfully loads the swf and everything works fine.
    My problem is that I can't guarantee our clients will have internet at all, so I need a solution to install AIR without internet and include whatever it is that my app needs to run.
    Any ideas? 'Cause this one's had me stumped for quite awhile.

    Does this happen whith every subVI or just on particular one? Also, what version of LV and OS?
    Lynn

  • Embedded SWF very slow to load in browser

    I have placed a swf slide show in Flash catalyst about 500k the problem is when I playback in the browser the embedded swf file displays long after the rest of the website has loaded and built. It works fine after I refresh and the file is loaded in the Cache.. but makes for a poor user experience when viewing for the first time, First impressions count.
    If I place the 500k swf in Dreamweaver it loads almost instantly from the remote server.
    For some reason Flash catalyst has a difficult time decoding and playing.
    The flash file was built in CS5 default settings.
    Any help on having the swf load first or process faster would be great.
    I know that file size is a issue but 500k is not that much.
    Heres the url.
    http://www.moonlightdigital.me/Test/home/home.html
    Thanks Curtis

    Hi Tanya,
    http://forums.adobe.com/message/2816273#2816273 like in this thread i used "On application start interaction" and i slected my swf files to load in application start.But i think nothing has changed.this the web site which i upload after that changes...http://www.fndim.com/altis2/main.html
    I think the problem is, in the preloader my embedded swf files doesnt installing to the browser...i want that everything is intalling with the preloader in the begining.If you want i can send you my fxg file..but i dont know how can i send it to you ?

  • Cap 2 - Embedded SWFs not loading

    Hey everyone...
    I'm building Captivate tutorials using Cap 2. As part of
    these, I'm creating separate simulations in Captivate, publishing
    them, then dropping the SWFs into slides on my larger project.
    So, the problem I'm having is that when I'm progressing
    through the larger Captivate module, I'll get to a slide that
    begins with one of the swf animations, and the slide audio will
    begin and the slide progresses, but the embedded swf is still
    loading. So, what happens is by the time the swf finally loads, my
    main timeline has moved almost completely past the animation...so
    basically, it screws everything up.
    I've tried using a preloader for the whole project, set to
    100% and that didn't fix the problem, which leads me to believe
    that the animations aren't actually loaded in that preloading
    process.
    I've tried synchronizing the animation with the project...no
    luck there. I've made sure that the embedded animations don't have
    preloading of their own. Nothing seems to work.
    Ideally everything would load up in the initial preloading,
    but I'd settle for having each slide wait until the contents are
    completely loaded before beginning.
    Any suggestions anyone might have would be greatly
    appreciated.
    Thanks,
    jb

    So I figured out a workaround for this issue, if anyone is
    interested.
    I republished the Cap projects I was imbedding into the
    larger project in Flash 8 format, and published the larger project
    in Flash 7 format. Doing so causes the larger Cap project to
    publish the Flash 8 swfs along with the rest of the published
    files, and then calls to those files instead of trying to imbed the
    swfs within the larger project. Works like a charm.

  • Delay in playing embedded video on page load – DPS

    Hi
    I've created some DPS pages with embedded video content that plays on page load but there is a slight delay causing the page below to be exposed which in turn creates a jump between the underlying page and the loading video.
    The video should load, play then disappear revealing the native InDesign page which also is a crisp version of the last frame of the video that has ended.
    I don't use a poster image because it renders at a low resolution and is not as crisp as the vector based text below in the native InDesign page.
    The page below is what is shown once the video has finished and closed down.
    This delay causes a glitch which ruins the fluidity of an otherwise nice looking page.
    I'm trying to re-create something along the same lines as the "Martha Stewart Living magazine" video front cover which is seamless and very slick.
    Do you know how I can achieve this without the slow loading vid and help make the effect smoother.
    Thank you in advance, I look forward to your reply.

    From your description it sounds like you are trying to trigger auto-play using Media panel. For DPS you need to set the behaviour in the Folio Overlays panel. Click on the video, open the Folio Overlay panel, and check the Auto-play setting. If you are doing this as a cover you probably also want to enable "do not allow pause".
    Neil

  • Interactive "on page load" animations in swf get messed up if clicked too fast

    interactive "on page load" animations in swf get messed up if I click too fast "next page" or "previous page".
    It seemes it can't manage on "page load" animations so fast, so as a result i have mixed animations for example of page1 and page2.
    if page1 has animation1 and 2 and i clicked next page, the next animation to appear is number 3 of page 2 , instead of number 1 which must be the first one to be triggered.
    This only happens if i click fast and several times the "next page" or "previous page.

    I have to say what you are trying might not be the best technique. The show hide might work ok for one or two items on a page but when you use it in the manner you are you are going to have the issues that you are now having...not to mention longer page loading do to larger file size of the page. My suggestion is to look into jquery and there are many plugins that can be modded to look the way you want however perform ten times better then using AP divs with show/hide.
    Here is one example that I found of a jquery plugin. There  plugin after plugin on the web for every scenario and they all can be modded to fit you needs. Do a search and you will eventually find something that fits your needs.
    http://www.twospy.com/galleriffic/#7
    http://www.twospy.com/galleriffic/example-2.html

Maybe you are looking for

  • How To Reinstall Mac Xerox Drivers

    I made the mistake of installing the Xerox Phaser 6360 drivers from the Xerox site. It caused long delays when trying to print - got the spinning beachball for up to a minute each time I tried to print. I'd like to reinstall the Apple Drivers. I have

  • Building a method with more than one result data

    Hi, everyone: I'm a little shy to ask this question, however, it's been hanging in my mind for so long, so I think I'd rather make a confession on it. You may laugh at me if you want, I'm ready for that, but I more look forward to that someone can re

  • DELETE_CONFIRM_MSG

    How can we alter the DELETE_CONFIRM_MSG in APEX. I am using Application Express 3.2.0.00.27. Presently the message is " Would you like to perform this delete action?". I am calling this JS in DELETE button javascript:confirmDelete(htmldb_delete_messa

  • How to run the same report at report runtime?

    i have this report that is automatically run when choosing the icon at reports runtime. its it possible that i can run the same report without having to exit the runtime?! can i display the run button on the toolbar? i need help on this! thanks

  • Problem viewing music on phone in ovisuite

    I dont usualy use Ovi Suite for music management as I re-encoded all my mp3 files to a lower bitrate but keep the full size ones in the Windows Music directory. But I deleted a playlist on my phone by mistake and wanted to recreate it so connected my