A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: Can mx do this?

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    167

    Can mx do this?

    I have a problem. I have an swf (movie A) that uses the loadmovie command to pull into it a jpg image. that works fine.

    I then have another swf (movie B) that pulls in the swf (movie A), this works fine but does not pull in the jpg that movie A holds.

    Please could someone explain?

    Tasvin

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    247
    I could be off-base, but it sounds out of order. Shouldn't you load the movie, then load the into that movie?

    Dain
    "Barney Rubble swings both ways."

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    It's the targetting. When you loaded A into B, the path changed for the jpg.

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    Hi there

    so i take it that its a problem with the initial movie that holds the jpg... so what do i need to change the target to?

    Thanks

    Tasvin

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Yes, you need to change the path for loadMovie. It's no longer the same, cause your loading movie A into B now, and the flashplayer got lost in finding the jpg.

    Copy the code here for both loadMovies, I can't tell without seeing the names of your clips or how you loaded it.

  6. #6
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Let's just say you used an empty clip in both movies for loadMovie, which you need to do anyway. The one in movie A is clip1, the one in B is mtClip. Then the code to load the jpg into A will now be:

    _root.mtClip.clip1.loadMovie("ashone.jpg");

    This will no longer work to load it in A by itself, only when A is loaded to B, but you have to test it anyway to make a new updated A swf.

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    Okay, here goes,

    this code is in movie a that should pull in the jpg

    loadMovieNum("bg01.jpg", 1);

    and i have this in movie b that pulls in movie a

    loadMovie("bg_image/bg01.swf", clip2);

    Thanks

  8. #8
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ah, your using a level for the first one. Not sure that's going to work. I've never had much luck targetting them even in simple situations. But try this in bg01.swf:

    _root.clip2.loadMovieNum("bg01.jpg", 1);

    If that doesn't work, use another empty clip in the loaded movie to load the jpg into and name it clip1. That will work with the code I gave you.

    _root.clip2.clip1.loadMovie("bg01.jpg");

  9. #9
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    Originally posted by iaskwhy
    Ah, your using a level for the first one. Not sure that's going to work. I've never had much luck targetting them even in simple situations. But try this in bg01.swf:

    _root.clip2.loadMovieNum("bg01.jpg", 1);

    If that doesn't work, use another empty clip in the loaded movie to load the jpg into and name it clip1. That will work with the code I gave you.

    _root.clip2.clip1.loadMovie("bg01.jpg");
    Hi iaskwhy

    I'm not sure what the hell i'm doing, i'm not an actionscripter but trying to get this to work... how would you do it without using levels then? I've tried what you said but it didn't work(or i didn't understand)

    thanks

    tasvinoooo

  10. #10
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Whoa!!!, Ha, just found out something new.

    In the first movie, just add this to a frame in the actions layer:

    loadMovieNum("bg01.jpg", 1);

    Your problem wasn't that it wouldn't load into the new movie, cause it will. Your problem was the code in the second movie. LOL.

    loadMovie("bg_image/bg01.swf", clip2);

    Is this on a frame, or just part of some button code? And what is bg_image? A folder? If it's not a folder, it has to go. If it is a folder, use:

    loadMovie("../bg_image/bg01.swf", "clip2");

    You have to quote the name of the clip too, that was the problem.
    Last edited by iaskwhy; 04-03-2003 at 08:21 PM.

  11. #11
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    okay i have this in the movie that pulls in the jpg and this works as a stand alone swf...

    loadMovieNum("bg01.jpg", 1);



    This doesn't seem to work, it pulls in the swf that contains the jpg, but not the jpg;


    The action to call the movie holding the swf that holds the jpg is on the main timeline and not a button.

    I must be doing something wrong, surely this can't be that hard?

  12. #12
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    So whats the code your using to load the movie now? I tested this here, and it worked fine, using the same loadMovieNum code you use, no changes. It loaded the jpg as a standalone and it the main movie loaded both. But like I said, what's this?

    loadMovie("bg_image/bg01.swf", clip2);

    Whats the bg_image thing? Is that a folder? Then your going to need to change the target on that jpg too, if it's also in that folder. Something like:

    loadMovieNum("../bg_image/bg01.jpg", 1);

  13. #13
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    So whats the code your using to load the movie now?
    loadMovie("../bg_image/bg01.jpg", clip1);
    this code is on the main timeline of the swf that pulls in the jpg, this swf sits in a folder called 'bg_image', this works fine but I need to the pull this swf into an swf which sits on the same level as the folder 'bg_image'

    loadMovie("bg_image/bg01.swf", clip2);
    this piece of code i have put into the master swf - i'm trying to call in the swf called 'bg01.swf' from the folder called 'bg_image' that sits on the same level as this master swf.

    Whats the 'bg_image' thing? Is that a folder?
    yes

    loadMovieNum("../bg_image/bg01.jpg", 1);
    i tried this, it doesn't seem to make a difference...

  14. #14
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    >>loadMovie("bg_image/bg01.swf", clip2);

    That won't work. As I mentioned above, you need to quote out the "clip2" thing also. Like this:

    loadMovie("../bg_image/bg01.swf", "clip2");

    And it's always best to put the 2 dots and the slash before the folder name. It tells the flashplayer to find it in a more efficient manner.

    In the movie that loads the jpg, if that jpg is in the folder, then you need to add that to the path too. It's all in targeting. I know the loadMovieNum thing works fine, cause I can duplicate it here.

    The code in the bg01.swf movie should be this, if the picture is in that folder:

    loadMovieNum("../bg_image/bg01.jpg", 1);

    That will work.

  15. #15
    Senior Member
    Join Date
    May 2002
    Posts
    132
    If I am picturing your problem correctly then it reminds me of a project in a book called drag slide fade.

    they also have a website

    www.dragslidefade.com

    hope this can be of some help

    pixelmagikau

  16. #16
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    great news.. . it works. ..

    but i have to have the main swf that pulls in the 'bg01.swf' file in the same folder... i need this master file to sit above this in the file structure, as in outside the folder 'bg_image'

    thanks for this help, i appreciate it!

  17. #17
    Senior Member
    Join Date
    Apr 2001
    Posts
    167
    actually, i works like a dream...

    but, i want to put the main file outside the folder that this file sits in, one level up, what would i need to do to point the code above to the folder that the swf sits in?

  18. #18
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    You lost me now. Your going to have to paste in the code that finaloly worked for you. I can't see your drive or your folders.

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