A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Brain Fart - targeting a movieclip - path problem

  1. #1
    Getting Better With Time
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    54

    Brain Fart - targeting a movieclip - path problem

    Hello everyone,

    Well I have a very basic question...it deals with paths...and I always seem to have a bugger of a time getting these things to work. I figured what the heck...why not try the friendly folks at Flashkit. Having said this, here is my problem.

    I have made a flash movie which is entirely composed of actionscript. It titled "initialize_prestige_interactive.swf." I don't have any images or anything on it. Its actionscript simply loads a bunch of movies into the correct xy coordinates. Below is a snippet of the code used to do this.

    //Portfolio Button - loads the services SWF file into the main time line.
    function openPortfolio() {
    _root.createEmptyMovieClip("siteContentPage_mc",_r oot.getNextHighestDepth());
    _root.siteContentPage_mc.loadMovie("../content/content_portfolio.swf");
    _root.siteContentPage_mc._y=160;
    _root.siteContentPage_mc._x=0;
    }

    /* THIS IS NOT WORKING
    portfolio_btn.onRelease = function()
    {
    openPorfolio();
    };
    */



    "Ignore the this is not working comment", as I have it working another way, and will worry about this on another day.

    As you can see, I have a function that has a movie clip created with the name "siteContentPage_mc", and it is here that the portfolio page is loaded. Well, on the portfolio page, there are a number of buttons that I want to have load additional movies into a mc clip titled "load_portfolio".

    Currently, I have the porfolio page set up to load a random swf file containing the information of one of my former clients. When I run the individual portfolio file on its own, it works wonderfully. When I run it through the initialize file, it cannot retrieve the client content that is to be randomly displayed. I know I have the paths messed up, and have tried a number of differing combinations.

    Here is the code I am using....

    choice = Math.round(Math.random()*9);
    switch (choice) {
    case 0 :
    _root.load_portfolio.loadMovie("portfolio/port0.swf");
    break;
    case 1 :
    _root.load_portfolio.loadMovie("portfolio/port1.swf");
    break;
    case 2 :
    _root.load_portfolio.loadMovie("portfolio/port2.swf");
    break;
    case 3 :
    _root.load_portfolio.loadMovie("portfolio/port3.swf");
    break;
    case 4 :
    _root.load_portfolio.loadMovie("portfolio/port4.swf");
    break;
    case 5 :
    _root.load_portfolio.loadMovie("portfolio/port5.swf");
    break;
    case 6 :
    _root.load_portfolio.loadMovie("portfolio/port6.swf");
    break;
    case 7 :
    _root.load_portfolio.loadMovie("portfolio/port7.swf");
    break;
    case 8 :
    _root.load_portfolio.loadMovie("portfolio/port8.swf");
    break;
    case 9 :
    _root.load_portfolio.loadMovie("portfolio/port9.swf");
    break;
    }


    I've tried something to this extent.....

    case 9 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "portfolio/port9.swf");
    break;


    Well as you can see, I am not a programmer..though I wish I was. I'd make millions..hehhehe...the site I am making can be viewed at www.prestigeinteractive.com.

    ps. anyone know how I can get a cute graphic (avatar) by my name..hehehe...

    Thanks a bunch for your help,

    Greg W.
    ____________________________
    Greg White
    http://www.prestigeinteractive.com

  2. #2
    Getting Better With Time
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    54

    Fixed...Moment of Clarity...

    Hey there everyone....

    Here is the code that was messing me up....thanks for looking with the intent of helping me out...it is greatly appreciated.

    choice = Math.round(Math.random()*9);
    switch (choice) {
    case 0 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port0.swf");
    break;
    case 1 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port1.swf");
    break;
    case 2 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port2.swf");
    break;
    case 3 :
    _root.load_portfolio.loadMovie("../content/portfolio/port3.swf");
    break;
    case 4 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port4.swf");
    break;
    case 5 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port5.swf");
    break;
    case 6 :
    _root.load_portfolio.loadMovie("../content/portfolio/port6.swf");
    break;
    case 7 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port7.swf");
    break;
    case 8 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port8.swf");
    break;
    case 9 :
    _root.siteContentPage_mc.load_portfolio.loadMovie( "../content/portfolio/port9.swf");
    break;
    }


    Hope this helps some of you out with the same problem. Note the different path for the swf...that is what I overlooked. I tried out a whole bunch of things with the _root...etc....but that was the wrong path.

    Later,
    ____________________________
    Greg White
    http://www.prestigeinteractive.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center