A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: loading external movie problems

  1. #1
    Senior Member
    Join Date
    Jun 2006
    Posts
    136

    loading external movie problems

    hi

    can someone help me with this little problem. I have have an external movie that loads in when a button pressed. within the main movie(load.fla) I have a scrolling menu, I've dropped the button with this so it will move with the image, but when I click the button the the external movie doesn't work. Is it something to do with the fact that the button is now embedded within the scroll movie????

    please would any beable to fix script on button
    cheers for your time

    example:
    attached is a folder with two files in 1. load.fla(main movie)2. movie_02.fla(movie trying to load)

    sorry heres the folder
    Attached Files Attached Files

  2. #2
    Dynamic Systems, Inc. mikaelian's Avatar
    Join Date
    Oct 2000
    Location
    DySyst.com
    Posts
    1,383
    I checked the FLA, and I am sure that the problem is in incorrect paths. For example, the function "initMovieLoad" loads the movie to the clip "monkey". And when your button is located deeper inside another clip, it does not find any clip "monkey" to load the movie to it.

    To you shold change the paths accordingly.
    Dynamic Systems
    Professional Web Development Solutions!
    www.DySyst.com

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    i cannot open your fla (mx2004 here) but decompiling your swf shows that you need
    to make the function global so it's scope is open to all levels of the Player -
    Code:
    // in load.fla
    _global.initMovieLoad = function(path) { ..... }
    
    // plus your buttons are using Flash 4 slash syntax
    // you should update this to dot syntax
    
    // slash syntax
     on (release) {
    tellTarget ('/graphics') {
    if (Number(_currentframe) == 27) {
    play();
    }
    }
    initMovieLoad('movie_02.swf');
    }
    }
    
    "/" is slash syntax for _root
    "../" is slash syntax for _parent
    
    // dot syntax
    on (release){
    if (_root.graphics._currentframe == 27) {
    play();
    }
     initMovieLoad('movie_02.swf');
    }
    }
    hth

  4. #4
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    hi there

    thanks for that I copied the code and it works great.

    about the dot syntax

    if I was to copy the code straight to my existing button would it still work or do I need to change the code with the menu section also??

    also looking at it there is no tell target, where you have

    if (_root.graphics._currentframe == 27) {

    does this replace

    tellTarget ('/graphics') {
    if (Number(_currentframe) == 27) {

    from the old slash syntax??

    thanks for your time

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    tellTarget was deprecated in Flash 5, slash syntax was used in Flash 4 -
    tellTarget ('/graphics') {
    if (Number(_currentframe) == 27) {

    these two lines are replaced by dot syntax -
    if (_root.graphics._currentframe == 27)

    test the code on a button, to save your old code,
    place comment delimiters around your old code
    /*..old code will be ignored...*/
    and paste the new code in place and test it,

    hth
    Last edited by a_modified_dog; 02-04-2007 at 01:50 PM.

  6. #6
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    ooh! yes it works....brilliant

    so the

    tell target

    is replaced with

    _root

    it works out as less code also. thats great cheers for all your help

    cheers

  7. #7
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    hey there

    I seem to have one final probelm which I hpe you can help with. Its carrying on from the movies we just been looking at. but now I'm trying to sit what we did in one main movie so that what we did loads and unloads from a main movie.

    the problem I have is I can get the load.swf(movie we was just working on) but when I hit another button in the main movie, I can't get it to unload and disappear.

    thought it might have been the _global thing so I added this to the main code in the main movie but still no joy.

    what movies we have;
    1.main.fla
    ( the main movie that starts, inside this two buttons, button1,button2. button one loads in the external movie load.swf, which then loads in all the other from that movie when the green buttons are pressed)

    2.load.fla
    the movie we've been working on

    3.movie_2
    an external movie that load.swf loads in.

    sorry if I'm not explaining myself, please find attached the example files exxample_02

    would you be able to have a look at tell me where I'm going wrong
    Attached Files Attached Files

  8. #8
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    i somehow have to tell button 2 to find the

    _root.graphics._currentframe == 27) {

    of the external movie load.swf that was loaded in by button 1

    arrrggghhhhh!!!! my head hurts

    can you help

  9. #9
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    please find attached the example files exxample_02

    as previously stated -
    i cannot open your fla (mx2004 here)

  10. #10
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    hey there

    sorry about that!
    any chance you could download flash 8 trial from adobe.com and have a look if you get the time???

  11. #11
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    easier for me if you save as MX2004 ( version 7)

  12. #12
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    hi there

    sorry about that am a little bit of a newbie, I've saved out the file from flash 8 to flashmx2004

    let me know if you can't open the files

    attached is the folderexample_02.zip

    thanks for your help I'm a little stuck with this, much appreciated
    Attached Files Attached Files

  13. #13
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    i've had a look and I am totally confused ( so is Flash )
    you have duplicate instance names in all the fla, so much so that
    you are getting paths such as - "_level0.menu.monkey.menu.monkey"

    i'll post what i've done so far, but you need to change the instance
    names so they are all unique, and then you might get it working

  14. #14
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    aaarrrggghhh! heads hurting

    cheers will have a look now

  15. #15
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    which instance names...the onces in the external moves loading in??

  16. #16
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    run your main movie
    load in a movie
    use CTRL+ALT+V to List the variables
    look at the confusion of duplicate instance names
    rename them and alter your code to suit the new instance names
    re-run your movie, load a swf, CTRL+ALT+V until it makes unique sense

  17. #17
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    change container name in external movie to 'motion' not sure if this is what you mean

    attached are files

    everything works I just doesn't unload the load.swf movie???
    can add some code to the button?
    Attached Files Attached Files

  18. #18
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    Target="_level0.motion"
    Target="_level0.menu
    Target="_level0.menu.MC2"(changed container name to MC2)

    i understand that these are the targets and that MC2 is where the movies load into.

    not sure what I'm trying to do here???
    all I can see is that it works but doesn't inload the load.swf external movie, which is loaded into

    Target="_level0.menu.MC2"(changed container name to MC2)

    but will not unload???

  19. #19
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    ok

    I've gotthe movies running on and out now, as I needed to add

    _global.loadNewMovie():

    at the end of the load.swf last frame

    but now the srolling section with the buttons don't work
    attaced are files
    Attached Files Attached Files

  20. #20
    Senior Member
    Join Date
    Jun 2006
    Posts
    136
    hi there

    well, I've got the load.swf now loading into the main movie.
    but now got the problem with loading in the externals to the movie load.swf

    would you beable to have a look as to why they are not loading in movies, movie1_02 and movie1_03

    any help would be great, cheers

    attached are the files
    load.fla
    movie1_02.fla
    movie1_03/fla
    Attached Files Attached Files

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