Link to home
Start Free TrialLog in
Avatar of yarmouth
yarmouth

asked on

loadmovie

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.
ASKER CERTIFIED SOLUTION
Avatar of jeffbeasley
jeffbeasley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yarmouth
yarmouth

ASKER

Done that already, isn't working thou
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

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
jeffbeasley,

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