Solved

loadmovie

Posted on 2001-07-10
5
451 Views
Last Modified: 2012-05-04
How do you load an external .swf movie into the parent movie?
And then tell it to open up in a specific place in your parent movie?
For example:
When you click on a button this will activate the loadmovie command and the new .swf movie will open up in  a square or specific area.
0
Comment
Question by:yarmouth
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
jeffbeasley earned 50 total points
ID: 6269393
you need a movie clip that is in the place were you want swf to load and load movie into movie clip
the reasoning behind this is that Flash defaults the loading of a movie to the upper left of the movie
loadMovieNum ("some.swf", "someclip");
someclip represents the instance name of your movie clip

Hope this helps,
Jeff
0
 

Author Comment

by:yarmouth
ID: 6269412
Done that already, isn't working thou
0
 
LVL 3

Expert Comment

by:jeffbeasley
ID: 6348597
I just posted this to your other question as you were deleting it
let me know if you still need it
Jeff

First you need to give the movie clip an instance name on the instance tag
when the motion tween is triggered
you need an internal frame loop set
Put the code inside your movie clip
from mouse click trigger event you want to write
On(release){
movieclipinstancename.gotoAndPlay(2);
}

if you want a horizontal line tween just use the number "23" represents the the final x position
frame 1
stop();
frame 2
if (this._x!=23) {
this._x=this._x++;
}
frame3
gotoAndPlay(1);

If you want a vertical tween use
frame 1
stop();
frame 2
if (this._y!=23) {
this._y=this._y++;
}
on frame 3
gotoAndPlay(1);

To create a motion tween that is given a multitude of options your going to need a function that calculates mathmaticaly the slope between both
points.

If you give me a day or so I can do this.
This is going to involve calculating your initial point.
and determining the rise over run from the two points; however you might note that in flash (0,0) is located in the top left portion of movie.  And Flash's y positions increase positively and you descend. meaning the y' go up as you move down.

To determine the exact x,y position you want to end up at
you will need to use your info panel this gives you the x,y position of your mouse and selected object.

Hope this helps, let me know if you want to tackle the formula or if you need me to try and put something together quickly.

Another note the reason you have to use a frame loop is because when you execute a loop on one frame the mc is moved when the code is finished not as the code is executing.

Good Luck
Jeff
Hope all this made since

0
 

Author Comment

by:yarmouth
ID: 6348632
on (release) {
    setProperty ("rightfly", _xscale, "210");
    setProperty ("rightfly", _yscale, "210");
    setProperty ("rightfly", _x, "-100");
    setProperty ("rightfly", _y, "250");
}

Above is the code I attached to the hidden button triggering off the event. All is well but I still need the square to tween. As you can see above my instance name is "rightfly". At the moment it's increasing by 210% and flying to the position of -100,250. I would much appreciate it if you could tell me how to set a tween from these 2 points. Still up for 100 points. What is the 'this.' all about??

Thanks
Louise
0
 

Author Comment

by:yarmouth
ID: 6348667
jeffbeasley,

PS: Above tween needs to be a diagonal tween, a bit to the right and a bit down! If that matters!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question