External swfs issues[renamed]

March 10th, 2010
  • I am trying to load an external swf into a main one. I think I may have cracked it but I would like it to load in a specific frame name or number.


    for example I am using this code: loadMovie ("homepage.swf", "_root");

    This links back to the main page from one of the external pages, however I wish it to bypass the intro so that anytime I return to the homepage, browswers are not bored with the same intro.

    so if the frame for intro is named "intro", and the post intro, homepage frame is labelled "home",

    how can this be achieved.

    Hope somebody can help. Thanks in advance


  • Dear Scotty,

    First of all, thank you for the speedy reply. I apologise for my late response, however I have had troubles logging into the forum.

    I tried this code that you kindly submitted and it did not work for me I am sad to say. However I think that I may be able to solve this problem if a slightly bigger one is solved with my navigation.

    If you would like to view the site the URL is (Please bare in mind that this is my first attempt at a flash website).

    http://nhjenkinssmith.com/

    Basically the problem I have is with component loaders.

    Initially I wanted to have a main file with the frame labels of each page strategically positioned on the timeline and with loaders on them to load the separate files with the pages on them. Now, for example, if you navigate to category, ‘graphic/print’ ad then to a page called ‘journeys by silhouette’, you will notice that I have not one but…..OH YES……TWO, sliding menus on the page, one for the images and one for the text.

    (This could only be achieved by mixing two methods using two tutorials so the code did not conflict).

    Tutorial for Text : http://www.aevision.com/tutorials/flash_sliding_pages.htm (http://www.aevision.com/tutorials/flash_sliding_pages.htm)

    Tutorial for Images : http://www.kirupa.com/developer/flash5/slidingmenu.htm (http://www.kirupa.com/developer/flash5/slidingmenu.htm)


    When I tried using component Loaders and published the site the pages loaded, however, you guessed it, neither of the sliding mechanisms worked for either text or images and just appeared to be frozen on the screen.

    At the moment I am navigating using this code (example navigate to page_whatever)

    loadMovie ("page_whatever ", "_root");

    }

    This of course is an ***-backwards way of doing it and when a link is pressed, the page blinks as it refreshes itself and sometimes the page it is linking to does not download properly and just leaves a white screen where a page should be.

    If I manage to get this to work then the original problem of bypassing the intro and heading straight for the homepage on the same timeframe will be easy as all I’ll need to do then is the use ‘gotoAndStop’ method.


    I hope that somebody will be able to help me as this has been a long standing problem that would make my site run more efficiently and smoothly.

    Thank you once again in advance

    Smudge:beer:


  • If you're using _root, everything on stage is gonna be replace by the new swf, this causes the blinking and the reason why my code didn't work, because the variable 'introSeen' is indefined again.

    Have a look at these tutorials, they might help you:
    http://www.kirupa.com/developer/mx/full_site.htm
    http://www.kirupa.com/developer/mx2004/transitions.htm
    plus search kirupa for portfolio/gallery, there are a lot of examples to do it with AS, which is the way to go if you efficiency and smoothness.

    For a first attempt, I think it looks good btw;)

    scotty(-:


  • no problem =)


  • Scotty,
    Thanks again for the heads up with these tutorials. Being new too flash I am looking over files and seeing how and why things work in the actionscript rather than being able to start from scratch. Hopefully these tutorials will be able to give me an idea of where I am going wrong.

    Thanks again and If it still persists, i'll be sure to repost again.

    Smudge


  • You can do that after homepage.swf is fully loaded, something like this may work:
    var introSeen;
    var ctrl = this.createEmptyMovieClip("ctrl", this.getNextHighestDepth());
    box = this.createEmptyMovieClip("box", this.getNextHighestDepth());
    function preloadHome(clip) {
    box.loadMovie(clip);
    ctrl.onEnterFrame = function() {
    if (box._width) {
    if (introSeen) {
    this._parent.gotoAndPlay("home");
    } else {
    this._parent.gotoAndPlay("intro");
    introSeen = 1;
    }
    }
    };
    }
    //usage
    preloadHome("homepage.swf");


    scotty(-:







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about External swfs issues[renamed] , Please add it free.