A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Importing swf into KM movie frame

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    3

    Importing swf into KM movie frame

    Good Morning all,

    My Name is John,
    I am new to Flash and action scripting, I have been for a while now a windows programmer C# and VB.net. and have within the past year been trying my hand at WEB design. You got to love it. At first i did not think much of flash for i have been studying hard at Silverlight. But recently within the past months have been blown away at the power and versatility of flash. You got to love it. I am using the KM 6.1.2 and am thoroughly impressed with it's capabilities and ease of use.
    I am studying the book from Collin Moock the Definitive Guide to ActionScript which i also find very good.



    I have been putting together a small project and wanted to import into one frame a mp3 player i created using another flash program Flash Music Studio 1.0, I know i can create mp3 players in KM but i had already created this one. From what i understand you need the swf file in the root folder with the calling swf file. But i am getting a load error. Is this an easy fix or should i just make another mp3 player in KM and bee done with it.



    If there is a post already covering this, direct me there. I have been looking and have not gotten quite the answer i need or understand.


    Also i find this forum to be a tremendous help with other topics i was interested in. I look forward to spending some time in here.


    Thanks John

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    You should be able to load your swf into KM. what is the code you are using to load the swf? And when you say you get a load error is that in your flash? and if so what is the exact nature of the error?

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    3

    importing swf

    Thanks for the quick reply blanius,

    I thought it would be as easy as drag and drop. I do not have any code to load the swf. I just used the import feature on the IDE in KM and imported my swf as an object. When played in the browser it comes up with "LOAD FAIL". I have run into this "LOAD FAIL" before, but it was due to syntax. What is the proper way to load a swf file into your a frame in KM. I am not looking for any free code just the proper procedure.

    thanks.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Is the loaded swf in the same folder as the main swf?

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I don't typically load swf in the GUI but I know you can. I use Actionscript to load it. There are a couple of ways to do it. Usually i place an empty movieclip on the stage, assume it's named mc1 then you would use this

    mc1.loadMovie("url_of_swf.swf");

  6. #6
    Junior Member
    Join Date
    Nov 2007
    Posts
    3

    importing swf

    Yes the swf is in the same file.

    I also tried putting the empty clip in the frame. Right clicked on the main stage and added the code suggested >>mc1.loadMovie("url_of_swf.swf"); i still received the load fail. i will explore this further before i wear out my welcom. I know i need to read up on this more to make sure i am doing it proper. I also checked the syntax in the script and it showed no errors.


    The swf file that i am importing has attached to it resource files such as thumbs and slides is the type or how the swf made make a difference? Or does that really matter.

    john

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    It occurred to me last night what might be happening. If the imported swf uses _root in its action script, the swf could lose its proper behavior when imported because the _root will then be the main timeline.

  8. #8
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by Bob Hartzell
    If the imported swf uses _root in its action script, the swf could lose its proper behavior when imported because the _root will then be the main timeline.
    It's true.
    To prevent this situation:

    mc1._lockroot = true;
    mc1.loadMovie("some_movie.swf");



  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    That is clever, Remus.

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