dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Load movie Tutorial ?

  1. #1
    Member
    Join Date
    Dec 2001
    Posts
    45

    Load movie Tutorial ?

    Hi all.

    Can anyone point me to a tutorial that shows how to create a flash file that uses buttons to load swfs movies from a designated folder. Im trying to do something similar to the load-movie sample that comes with Flash MX, but with menu buttons and swfs instead of jpegs.

    Thanks in advance.

    Secoast.

  2. #2
    Senior Learner garion1's Avatar
    Join Date
    Dec 2001
    Location
    South Africa
    Posts
    483

    Example code

    Hi.
    Create your buttons. Create an empty Movie Clip and place it on the stage with instance name "emptyclip". Now add the following code to your timeline on the same frame as 'emptyclip':

    button1.onPress = function() {
    loadMovie("myswffolder/screen1.swf", emptyclip);
    }

    'button1' is an example instance name of your first button.
    'screen1.swf' is the swf you want to load
    'myswffolder' is an example of a folder you might have your swf files in

    Remember that your swf file will load with it's top left corner where 'emptyclip' is on the stage.
    "A day without laughter is a day wasted." - Charlie Chaplin

  3. #3
    Member
    Join Date
    Dec 2001
    Posts
    45
    Hi

    Thanks for the prompt response....Unfortunately, I tried the method you suggested last night, but was unable to get it to load a movie. I have uploaded the files to show what I have done and would be grateful if you could inform me of where I might be going wrong.

    Many thanks

    Secoast
    Attached Files Attached Files

  4. #4
    Senior Learner garion1's Avatar
    Join Date
    Dec 2001
    Location
    South Africa
    Posts
    483
    Hi.

    You did not give any of your objects instance names.

    You cannot refer to an object on the stage with code unless it has been assigned an instance name.

    To give an object an instance name, you must select the object on the stage and then type an instance name in the 'Properties' panel.

    See attached.
    Attached Files Attached Files
    "A day without laughter is a day wasted." - Charlie Chaplin

  5. #5
    Member
    Join Date
    Dec 2001
    Posts
    45
    Hi again.

    I had assumed naming the symbol determined its instance name, but clearly this is where I went wrong. Will give this a go tonight.

    Thanks again. you're a real star.

    secoast

  6. #6
    Member
    Join Date
    Dec 2001
    Posts
    45
    Garion1.

    Now I get it, and everythings working just fine... I even figured out that adding another button that had no movie linked to it would close the current movie. This is useful because it means I can have my loaded swf movies hide the main menu buttons, closing a movie allows you to view the menu buttons again. Basically, a Return To Menu button.

    One other questions.

    Ive attached a copy of the (play movie) file, but this time with some swf screen capture video on button1. On the original swf (screen1) it plays perfectly, but when loaded it displays artifacts, as if it is not displaying at a true 100%. Any ideas why this might be happening?

    Thanks again for your help. It is genuinely appreciated.

    Secoast
    Attached Files Attached Files

  7. #7
    Senior Learner garion1's Avatar
    Join Date
    Dec 2001
    Location
    South Africa
    Posts
    483
    I see. Make sure that your capture swf is at 100% scale on the stage. If its instance name is videoSWF, add this code to the timeline:
    this.videoSWF._xscale=100;
    this.videoSWF._yscale=100;

    If that doesn't work, your best bet will be to convert the video to an FLV file using Flash Video Encoder and dynamically load the FLV onto your stage. You shouldn't lose quality that way.
    "A day without laughter is a day wasted." - Charlie Chaplin

  8. #8
    Member
    Join Date
    Dec 2001
    Posts
    45
    Thanks again...Will give that a go tonight.

    Secoast

  9. #9
    Member
    Join Date
    Dec 2001
    Posts
    45
    garion1.

    Because captured video is not exported from Flash and I can't add code directly to each video swf. Is there a way of commanding the loaded movies (video's) to display at 100%.

    Thanks

    secoast
    Last edited by Secoast; 02-14-2008 at 11:12 AM.

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