A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: (CS4 - AS2) How do I get an external swf to load and POSITION in main file?

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    10

    (CS4 - AS2) How do I get an external swf to load and POSITION in main file?

    I'm trying to get a swf file to play in a main swf file. I can get it to play, but it always appears in the top left corner. I've tried several different methods to position it but every one of them either doesn't work or won't play the file.

    Here's what I'm using right now.
    Actionscript Code:
    stop();
    loadMovieNum("circles.swf", 1);
    var xset = 381;
    var yset = 179;
    The swf plays just fine, but it won't take the coordinates.

    I also need to get it to stop when I go back and the command
    Actionscript Code:
    unloadMovieNum(circles.swf);
    doesn't work.

    A tutor in my class showed me a method to place the swf into a box on the main stage without doing a lot of scripting, just putting in some file-name and size/position references, but he's not available right now to ask how he got that started. If anyone knows what I'm talking about and can either direct me to it or link me a video on that, that would be great.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    loadMovie("circles.swf", container);

    place an empty movieclip at the desired top left coordinates. Give it the instance name container via it's properties panel and use that line of code. You will be using loadMovie (and unloadMovie) instead of loadMovieNum

    gparis

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    10
    Doesn't seem to work. Now the swf doesn't load up at all.

  4. #4
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    You are creating an empty container named container correct?
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  5. #5
    Junior Member
    Join Date
    Feb 2010
    Posts
    10

    Unhappy First problem fixed. Now for the new problem.

    I found the problem. I had placed the loadMovie("circles.swf", container); action INSIDE the movie clip, rather than on the frame with it.

    The clip will now play, but every time I test the portion of my main swf that brings up the secondary swfs it opens up two copies of Safari and two Finder folders of the Desktop (where the main swf and the circles.swf are located).

    Is there a way to make it just load up in the background and not throw all this stuff up in front of the flash while it's supposed to be playing?

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    any getURL's somewhere. only that would open a new browser window.

    gparis

Tags for this Thread

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