Help a Newbie - Need to Embed swfs into main swf

I have made a MAIN SWF in which if you click one button, it
loads one SWF, if you click another button, it loads another SWF.
The file works perfectly when I test the MAIN SWF...until I
relocate that MAIN SWF to another file, then it doesn't load the
internal SWFS. How do I publish the MAIN SWF with the other two
SWFS embedded? So that my client only has to upload one single SWF
file and not host the internal ones somewhere?
Hope this makes sense...Flash is completely foreign to me, so
be gentle. Thanks!

Treat Flash as any other content and place it within its own
containing div. Position the div in the normal flow of the document
allowing the div to 'stack' with the other divs above and below it.
If you want to place the Flash such that it 'covers' existing
content you can use CSS positioning techniques. Options include
absolute positioning the containing div with the Flash swf within
it (this removes the div from the normal flow of the document) and
placing it over the existing content. Us position: absolute; and
top and left, with px values to place the div where you need it.
You can find tutorials on absolute positioning in the developer
center or www.communitymx.com
You can use the float property and negative margins to pull
containing divs (or other elements) around the document, too.
Experimenting with floats can be fun but you need to read up on
their specific behavior as you can end up pulling your hair out.
Again, there are plenty of CSS tutorials on positioning and a
Google search should throw-up some options.
Outside of CSS you can use DOM Scripting and JavaScript to
also position and hide various content depending on your
requirements. If you get stuck come back on this forum and ask for
more help but provide specific code to help us.

Similar Messages

  • Need help embedding photo gallery swf into main swf...

    So I am attempting to create a website in flash and have the
    main swf created for that. However, I've also created a photo
    gallery in a separate swf which I want to embed into one of the
    scenes in the main swf. I tried importing directly to stage, but
    quickly realized that the timeline from the photo swf would not get
    carried over. Basically, I know that it has to be accomplished
    using AS, but don't know what that script would be. Any help would
    be appreciated!

    OK, well, that wasn't really a tutorial as much as it was
    just a huge section of code I couldn't make sense of. Anyways,
    instead of loading the gallery externally now I decided to just
    make it in the actual main swf. So, basically, in the section of
    the main swf reserved for the gallery I created an empty movie
    clip, went inside the clip, created layers for script, thumbs and
    photos. The photos themselves were in a movieclip of their own.
    Each photo has a small fade in accomplished by staggering the
    keyframes for each photo with a stop(); action on the last frame of
    each photo where it comes to full opacity. The thumbnails are back
    in the main movieclip where each button has code telling it to go
    to the beginning of each photos transition and play. It is supposed
    to play until it hits that stop action, but it won't play at all.
    Suggestions?

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • GotoAndPlay specific frame in external swf from main swf

    I have a main swf that loads 2 external swfs.
    I click on button to see content of external swf #1 and see stuff. I do something that causes external swf to show other stuff (i.e. not at beginning state)
    In the main swf I click on button to see content of external swf #2. External swf #1 content is made invisible and I see content of external swf stuff.
    NOW, if I click on button to take me back to see external swf #1, I see it's content in current state. I want to force it to start over again at frame #1 which will reset content.
    However, no matter what I try, I can't seem to control which frame to go to in external swf using gotoAndplay.
    Here is code in frame #1 of main swf to load external swfs:
    //load academic movie
    var swfLoader1:Loader = new Loader();
    container1.addChild(swfLoader1);
    var url1:URLRequest = new URLRequest("academic.swf");
    swfLoader1.load(url1);
    //load wisdom movie
    var swfLoader3:Loader = new Loader();
    container3.addChild(swfLoader3);
    var url3:URLRequest = new URLRequest("wisdom.swf");
    swfLoader3.load(url3);
    Here is code in frame 2 of main swf that checks button to see where to go in external swf:
    //academic button clicked
    function academicClick(event:MouseEvent){
       container3.alpha = 0;
       container3.visible = false;
       container1.visible = true;
       container1.gotoAndPlay(1); //this is where I am trying to force it to start at frame 1
       container1.alpha = 1;
    I don't want to reload the external movie to force it to start over.
    Any help would be much appreciated.

    You can easily control this by making the external swf to load with your movieclip, The below is the code snippet that clear on accessing the specific frame on external swf.
    //Loading clips content
    var ldr:Loader;
    var mcExt:MovieClip;
    //Loading
    loadswf("external.swf");
    function loadswf(tmp:String):void{
        unloadSwf();
        ldr= new Loader();
        ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
        ldr.load(new URLRequest(tmp));
        function progressListener (e:ProgressEvent):void{
            ploader.visible=true;
        function swfLoaded(e:Event):void {
            mcExt = e.target.content as MovieClip;
            ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
            mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
            ploader.visible=false;
            addChild(mcExt);
    //UnLoading
    function unloadSwf():void{
        if (ldr!=null){
            ldr.unloadAndStop();
            removeChild(mcExt);
            mcExt=null;
    //Intervals (The part you work on the specific frame within the external swf
    function onEnterfn(e:Event):void{
        var num:int=mcExt.currentFrame;
        if (num==1) mcExt.play();
        if (num==9) {
                mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
                function skipfn(e:MouseEvent):void{
                    mcExt.stop();
                    mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                    gotoAndStop("help");
        if (num==mcExt.totalFrames){
            mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
            gotoAndStop("help");
    hope it solve

  • Need help with loading child .swf into parent .swf

    Hello,
    I am having trouble with an external .swf that isbeing loaded
    into the master.swf. All of the files loads perfectly. However the
    .swf that has the contact form movieclip in it will not work. The
    combobox does that display any of the items listed and the form is
    not being sent to the server. Can anyone give me a hand with
    this?

    can you post your code

  • Need help loading and positioning a swf into a swf

    This is the swf  I'm trying to load.
    These actions load and position a small simple swf just fine and the trace in the onLoadProgress function indicates that it loads completely
    but I can't see it.  What am I doing wrong?
    this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
    var my_listener:Object = new Object();
    my_listener.onLoadComplete = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    my_listener.onLoadProgress = function(target_mc:MovieClip) {
    trace(target_mc.getBytesLoaded() + " out of " + target_mc.getBytesTotal());
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    //my_loader.loadClip("little.swf", container_mc);
    my_loader.loadClip("cam01.swf", container_mc);

    do you see a rotated swf if you use:
    this.createEmptyMovieClip("container_mc", 1);
    var my_listener:Object = new Object();
    my_listener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    target_mc._rotation = 22;
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    my_loader.loadClip("cam01.swf", container_mc);
    if yes, either:
    1.  you are repositioning your swf and for some reason don't recognize that or
    2.  you're changing container_mc or one of its parents _x,_y properties elsewhere.

  • Help! Newbie needs a bit of advice :)

    Trying to put up a website in tables & cells....can't
    seem to get answers to a couple of Q's.
    Any experts out there that could offer insight would be much
    appreciated!
    Here's the sitch :
    Down the left side of my page is a list of services, I want a
    mouseover action on each of these services to cause the HTML text
    to the right of the services list to change to an explanation of
    that service, and to change the picture to the right of that text
    (in yet another cell) to a picture of that service. So one
    mouseover will cause both of the two neighboring table cells to
    change their content. THE TEXT IS IN HTML and cannot be an image
    for SEO purposes.
    The second question regards a different page. I have text
    that is too big for its table cell. I was wondering how to put a
    scroll bar in a table cell.
    If anyone knows the answer or can point me in the right
    direction it would be so helpful!!
    Thanks :)
    eLi

    eLi The Girl wrote:
    >
    > Trying to put up a website in tables &
    cells....can't seem to get answers to a
    > couple of Q's.
    > Any experts out there that could offer insight would be
    much appreciated!
    > Here's the sitch :
    > Down the left side of my page is a list of services, I
    want a mouseover action
    > on each of these services to cause the HTML text to the
    right of the services
    > list to change to an explanation of that service, and to
    change the picture to
    > the right of that text (in yet another cell) to a
    picture of that service. So
    > one mouseover will cause both of the two neighboring
    table cells to change
    > their content. THE TEXT IS IN HTML and cannot be an
    image for SEO purposes.
    Your going to have to use some kind of layer/s for that.
    Use 'settextofLayer' under the 'behaviours' in Dreamweaver.
    Heres an article explaining how to use it:
    http://www.dreamweaverresources.com/tutorials/settextoflayer.htm
    > The second question regards a different page. I have
    text that is too big for
    > its table cell. I was wondering how to put a scroll bar
    in a table cell.
    Here an article form the same website detailing how to put a
    scrolling
    area into a table cell:
    http://www.dreamweaverresources.com/tutorials/scroller.html
    > If anyone knows the answer or can point me in the right
    direction it would be
    > so helpful!!
    > Thanks :)
    > eLi
    >
    >
    Heres a simple example of code using 'settextoflayer and a
    scrolling area:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    #contentLayer {
    position: relative;
    width: 200px;
    border: 1px solid #000;
    top: 0;
    left: 0;
    #contentLayer p {
    margin: 0;
    padding: 0;
    #right {
    width: 200px;
    #myTable {
    margin-left: auto;
    margin-right: auto;
    #myTable td {
    vertical-align: top;
    #scroller {
    height: 150px;
    overflow: auto;
    </style>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document;
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for
    (i=0;!x&&i<d.forms.length;i++)
    x=d.forms
    [n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers.document);
    if(!x && d.getElementById) x=d.getElementById(n);
    return x;
    function MM_setTextOfLayer(objName,x,newText) { //v4.01
    if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText));
    document.close();}
    else innerHTML = unescape(newText);
    //-->
    </script>
    </head>
    <body>
    <table id="myTable" width="600" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td><a href="#"><p
    onMouseOver="MM_setTextOfLayer('contentLayer','','Good
    Morning')">Link
    One</p>
    </a>
    <a href="#"><p
    onMouseOver="MM_setTextOfLayer('contentLayer','','<p>Good
    Afternoon</p>')">Link Two</p></a>
    <a href="#"><p
    onMouseOver="MM_setTextOfLayer('contentLayer','','<p>Good
    Night</p>')">Link
    Three</p></a></td>
    <td id="right"><div id="contentLayer">
    <p>Good Morning</p></div></td>
    <td id="right"><div id="scroller">
    <p>This text scrolls once it reaches a height of
    150px.</p>
    <p>This text scrolls once it reaches a height of
    150px.</p>
    <p>This text scrolls once it reaches a height of
    150px.</p>
    <p>This text scrolls once it reaches a height of
    150px.</p>
    <p>This text scrolls once it reaches a height of
    150px.</p>
    </div></td>
    </tr>
    </table>
    </body>
    </html>

  • Nest AS3 swf into AS2 swf

    I purchased a flash template written in AS2, i have all files needed to customize this site, .fla, psd's you name it. I also purchased a photo gallery that is written in AS3 (did not know it was AS3 when purchased) . My question: is there any way to embed/nest the AS3 photo gallery, which i the swf file for, into my AS2 website?

    Per AS3 documentation:
    A single SWF file cannot combine ActionScript 1.0 or 2.0 code with ActionScript 3.0 code.
    SWF files written in ActionScript 1.0 or 2.0 cannot load SWF files written in ActionScript 3.0. This means that SWF files authored in Flash 8 or Flex Builder 1.5 or earlier versions cannot load ActionScript 3.0 SWF files.
    The only exception to this rule is that an ActionScript 2.0 SWF file can replace itself with an ActionScript 3.0 SWF file, as long as the ActionScript 2.0 SWF file hasn't previously loaded anything into any of its levels.

  • Load AS2 swf into AS3 swf

    here is the code i'm using:
    var url:String = "avm1.swf";
    var urlrequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loaderListener(loader.contentLoaderInfo);
    loader.load(urlrequest);
    function loaderListener(dispatched:IEventDispatcher){
    dispatched.addEventListener(Event.COMPLETE, assignSWF);
    function assignSWF(event:Event){
    addChild(loader.content);
    here is the error i get:
    It is illegal to move AVM1 content (AS1 or AS2) to a
    different part of the displayList when it has been loaded into AVM2
    (AS3) content.
    Is there a different way to do this?

    addChild(loader)

  • How? loading seperate music player .swf into main site prob.

    hey all!
    Ok something that I still don't really understand, have tried
    to modify afew flas but with no luck.
    Anyhow to the point. I have a main fla file with all my
    content in it and a litlte music player that plays 3 to 4 external
    swfs with music &animated LEDs in it. Anyways right now the
    music player itself is built into my main fla file. I would like to
    move the player a little bit so its coordinates change.However
    obviously when i do this and test movie the external music swfs
    that load have little LED moving animations and the 2 files just
    dont match up, so they load into the wrong area. I also tried to
    move the LED elements exactly the same amount as i did with changes
    in the main fla in moving the music player graphics but still not
    working. Do you think these files are working with "tell
    targetting" or? Im sorry im awful with code so..
    Any good and simple tutorials for a numb nut like me would be
    appreciated on this topic so i can understand whats really going on
    here. Normal logic doesnt seem to be getting me all that far.
    Tks!

    ahh thanks Jeff i guess i would say for nuthin.
    Hopefully someone else can give me a litte bit more to go on
    then that!

  • How to upload a swf into another swf??

    Hi, forgive my ignorance for I am new to the programming world!
    I have a game and I'm trying to get it so when the user presses a button, it cuts to the menu screen (a separate swf file)
    Now I know how to do this in AS2 -
    next_btn.onPress = function() {
         loadMovie("car1.swf","_level0");
    But I want to learn how to do it in AS3! I've searched on a few websites for the possible code, but they've all left me feeling very confused and with this:
    next_btn.addEventListener(MouseEvent.CLICK, menu);
    function menu(e:MouseEvent): void {
         var loadit = new Loader();
         addChild(loadit);
         loadit.load(new URLRequest("menu.swf"));
    Now, I have no idea what the last 3 lines of that code means and it doesn't appear to work either...
    If anyone could help me that would be swell!

    The code you show should work so long as you have a button with that instance name in the frame where the code is (different layer, preferably) and an swf file by that name in the directory where you've saved this file.
    If you want to begin to understand the code try reading thru the help documentation for the Loader class.

  • Trigger swf from main swf

    Alright so i'm fairly new to AS3 and flash in gernal, have done a bit of work in flash but nothing this major and need some help. I have a longtail flash player setup to a rtmp server to stream live events using adobe flash encoder 3. In gerneral it works fine now the problem is content i have a second swf file within the same page that was a powerpoint presentation that is now converted to a swf.
    What i need to do is somehow send a command from the longtail video player to the slide show to trigger a slide push. So lets say we are live and streaming away i would need to send some sort of command that will tell the second swf to change slides so that everything is in sync.
    Currenty we are using Windows media enncoder and we just send out a command to a iframe within the encoder which changes the slide, the slides are JPG so its easy to do. In the testing stage we have a standalone slide controller that is linked to the iframe and we can push a slide from the contoller which push the slide on the iframe. This method works if i remove wmp and put in a flash place since it not going through a video stream, but i need it to go through the video stream and then tell either a swf to change a slide or an ifreame to change a slide.
    Reason it has to go through the video stream is so we can record the video and the commands so they can be setup as archive, so video and slide will cue at the right areas. Just like how you can send out commands from within windows media encoder and archive them and they auto trigger once he video plays.
    Well i just need a way that will sync video with slides i don't really care how its done just that its done. There has to be a way to record the slide push commands so they can be used again to play the video and so it advances the slides.
    PS this is related to my Job

    If you want to inject metadata into a life stream, you, perhaps, need to look into Flash Interactive Server. This forum is not a server forum tough. Managing FMS is a special skill/knowledge set. There is FMS forum.

  • ActionScript 2.0 to be able to embed URL into SWF file?

    Hello,
    It seems that the web based newspaper who is going to publish my ad banner doesn't have flash player 10 (or 9). My ad banner was made in Flash CS4 / ActionScript 3.0. Instead I now have to change the code in my invisible button to ActionScript 2.0 to be able to publish it in flash player 8. What is the ActionScript 2.0 code so I can make the same embed URL into my SWF file as I did with the following ActionScript 3.0:
    function linkToSite(evt:MouseEvent):void {
         var url:String = "http://www.IMAGESofFISHERMEN.com/?p=50#more-50";  // replace with your url
         var req:URLRequest = new URLRequest(url);
         navigateToURL(req, "_self");
    urlBtn.addEventListener(MouseEvent.CLICK, linkToSite);
    Regards
    Maria

    As far as I know, the Flash player version should not be of any significance to the host service.  It is the Flash player in the site visitor's web browser that decides matters.
    In any case, that code would become...
    urlBtn.onRelease = function(){
         getURL("http://www.IMAGESofFISHERMEN.com/?p=50#more-50", "_self");

  • I need to access/pass variables'(s) of a .swf file into another .swf file.

    Hi all,
    I have basic knowledge of Flash and AS3.0.
    Suppose i have a flash swf file(main.swf). In this main.swf
    file, i loaded another swf file(sub.swf) by writing the following
    code snippet in main.swf file as shown in Attach Code:
    Now, how to acess the data present in main.swf into sub.swf.
    Note: Here data represents values/data stored in
    variables/objects of main.swf file.

    Does this actually work -- assigning variables directly on the loader?  I'm interested in setting flash variables on the loaded SWF, but I get a compilation error when trying something similar:
    Error: Access of possibly undefined property x through a reference with static type flash.display:Loader.
         [exec]
         [exec]             textLdr.x = 50;
    I also tried casting the loader to Object, which compiles but then fails at runtime.
    -Dave

  • Textbox shows xml text in working file but now when loaded into another SWF

    Hi all,
    I have downloaded an xml gallery (as2) as we needed one for an old as2 file. Now I mostly use as3 but thought as I only needed to tweak it there would be no probs. Of course, it rarely works out that way. The problem is, text loaded from the xml file is displayed with its corresponding image. This works fine in the file. When I load the SWF into another SWF however, it all works EXCEPT the text doesn't show at all?? Whoever made the gallery used 'device fonts' in the textbox, I don't know if this has anything to do with it. I tried changing the textbox to dynamic and embedding characters but still nothing.
    This seems the key line -
    _root.descmc.desc.htmlText = XMLdaten[number];
    I have also tried
    _root.descmc.desc.htmlText = XMLdaten[number].firstChild;
    This traces out the correct xml data when tested so it is finding it okay.
    Any help would be much appreciated.
    Thanks

    The problem might be in the use of the "_root"  You probably need to set _lockroot = true; in the loaded swf, otherwise the _root is that of the loading swf, not the loaded one.

Maybe you are looking for

  • Error while Loading Mail.jar in Database

    Hi, I am trying to load mail.jar in Oracle 8i Database(ver. 8.1.5.0.0). It is giving error insufficient previleges. Then I extracted mail.jar and tried to load class PasswordAuthentication of mail.jar in user scott. It gave me same error. But I could

  • _pages does not exist running jsp on Linux

    Hi Wrote some jsp's and was running them using iAS 8i on Win 2000. I've now come to move them to their new home on a Linux machine running redhat and I get the following error: Request URI:/dbserv/ds.jsp Exception: java.lang.IllegalArgumentException:

  • "Error in the application" while creating Records Center

    I get "Error in Application" error every time I try to create Record Center. The error is the same for every Web App in the farm. Can I please know what all are the pre-requisites for successful creation of Record Center? or else, what might be causi

  • Idvd does not burn dvd

    idvd does not burn project to dvd

  • Using Barcode in reports 10g

    Thank U for the .zip, I generated the barcode successfully. My code has 60 characters and the barcode reader doesn´t recognize it. I reduced the length of the it and the reader recognize it. I´m using BAR_CODE_128, I already tried with the rest of th