dcsimg
A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Swf into fla doesn't work

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    8

    Swf into fla doesn't work

    Hi I have a question that I have looked everywhere to find the answer for and would really appreciate your help. I have a swf that is pretty complicated, you can interact with the page and go to different keyframes and it stops and/or starts depending on buttons, but I want to put it in a fla or something so I can put other swfs next to it and build it up and put several of them together as one.

    I don't care about making it too complicated, I just want one interactive swf to go to the next compiled swf when that movie ends, but when I try importing it or loading it it just runs straight through without stopping or paying any attention to the scripting. Am I loading it right? Stupid question I know but surely its possible somehow!!

  2. #2
    Member
    Join Date
    Mar 2007
    Posts
    79
    Ok, you cannot just import a swf into the Fla for it to work.
    You need to use loadMovie(); so swf2 loads into swf1
    You could place an emptyMC in your main swf and give it an instance name (ie. emptyMC) and use
    loadMovie("swf2.swf", _root.emptyMC);

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    It says the class or interface cannot be loaded

    I don't understand I've given it the instance name, checked the path, checked your code, made sure no names have been confused, taken the movie clip and put it onto the screen, made the screen bigger, tried it with other images and they come up but I still get the error message ... do I have to set up something beforehand?

  4. #4
    WohOoooooo zompo's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    138
    Check so that you have your project running with acionscript 2 and not 3 maybe thats the problem


    Try out my game http://alpha.bombwar.com - Alphakey: fkaplha

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    79
    what version of as?
    loadmovie is as2

    maybe posting ur code will help us see whats happening...

    swf2 shouldn't be placed in the movie, it should be loaded externally when swf1 loads. Get me?

    I'll wait 4 code :-)

  6. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    thank you for the replies... no I am not confusing actionscript 2 with actionscript 3, although I don't mind either way!

    I have a file called 0.swf to be loaded into my movieclip instance called movie on the first frame. I just can't get my head round the syntax. The best I can think of is

    onClipEvent(load){
    _root.movie.loadMovie("0.swf");}

    I know I'm close... I think!

  7. #7
    Member
    Join Date
    Mar 2007
    Posts
    79
    Morning - Try using the main tmeline and create a function.
    function loadMC () {
    _root.loadMovie("0.swf", movieTarget)
    }
    loadMC();

  8. #8
    Junior Member
    Join Date
    Jul 2009
    Posts
    8

    given up

    Hi just getting back to you

    Sorry that doesn't work, I have tried lots of tutorials and still have no idea how to arrange the syntax so that onClipEvent(load) recognizes the function of loadMovie(); which loads the instance of my movieclip. Never thought this could be so hard. Thanks for your response though I appreciate it

  9. #9
    Member
    Join Date
    Mar 2007
    Posts
    79
    Not sure what your doing wrong.
    Here is a simple example. Open swf1.swf and click the button.
    It will load swf2 in to the blankmc
    Attached Files Attached Files

  10. #10
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    Thank you but your example did what I was afraid of, the compiled fla runs through the externally loaded swf without paying attention to the coding within it... I'm completely lost at this stage and better look for another way to do what Im doing

  11. #11
    Member
    Join Date
    Mar 2007
    Posts
    79
    I'm not sure I follow - actions in swf 2 should run fine.
    What sort of actions are swf2 doing?

    Again, another example zip with actions in swf2.

    Maybe you can post a zip of your files and I can take a look?
    Attached Files Attached Files

  12. #12
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    I'm sorry my keeps internet cutting out

    Here is what I am trying to embed with its scripting into another fla it is in actionscript 3 but I thought that embedding it within actionscript 2 wouldn't make much difference

    I'm aware that I probably won't be able to transfer much (if any) information between each swf, but I just want it to work for now

    http://www.mediafire.com/?sharekey=6...4e75f6e8ebb871

    I'm sooo frustrated at learning a little actionscript 3 and not being able to use it in 2!

  13. #13
    Member
    Join Date
    Mar 2007
    Posts
    79
    Sounds like your problem. An AS2 compiled SWF will not run AS3 code!
    I'll take a look at your files after I've finished watching my film :-)

  14. #14
    Member
    Join Date
    Mar 2007
    Posts
    79
    I'm only using CS3 - u able to re-save it plus send both fla files so I can maybe give you some pointers on the AS3 re-coding?

  15. #15
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    Hello just getting back
    I am sorry that I didn't mention it was in as3 before... I thought that if it was a compiled swf it wouldn't matter!

    I have saved it to cs3 on this link http://www.mediafire.com/?sharekey=6...4e75f6e8ebb871

  16. #16
    Member
    Join Date
    Mar 2007
    Posts
    79
    ok, I have to admit, I'm lost as to what your trying to achieve.
    I understand the code, but don't understand things like, why you use import gs.*; 3 times.
    What is the final outcome of your flash movie?

  17. #17
    Junior Member
    Join Date
    Jul 2009
    Posts
    8
    import gs.* is tweenlite. The purpose of the movie should be fairly self-explanatory..

    I would like to know how to compile this file and have it running as a workable swf within another fla, so I could compile other swfs and have them running into each other. So if I had ten examples of what I gave you, then I could import them into one fla and have them follow each other in sequential order upon each swfs completion.

    So if they are made in actionscript 3 then only actionscript 3 will recognize them? Ok I will look into that

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