PDA

View Full Version : need a"empty"mc to load different swf´s at different exatx,y positions


photopatrick
05-17-2004, 12:36 PM
Learning by trying.

I'm trying to figure out how to make a"empty"mc to load my swf's in.
The thing is that I've got this box tweening to different sizes and I wanna load swf's in to that box controlled by the same mc that "controlls" the size of the box.And the way I've aranged everything "logic becomes non logic"

So I've tied to make a "empty" mc on the layer above the box and everything works ok(well maybe not but the swf loads anyway.)

But then I have to make as many "empty" mc as swf's I wanna load ehrr.
Not the best way I know.

The next thing is when I try to make the "empty" mc layer to a guidlayer(I dont wanna se the "empty" mc on stage)the swf loads to the x position as the mc I'm calling the action from.

There must be a better way to work this out.I've tried to find tutorials about this with no luck .

Here's the fla and a test swf u guys if u wanna take a look at it.
This is the code.

#include "easing_equations.as"
#include "lmc_tween_as1.as"

menuPad = 10;

function resizeBox(w,h)
{
box.tween(["_width","_height"],[w,h],2);
menu.tween("_x",box._x+w+menuPad,2);
}

And in the mc that controlls the size of the box

on(release) {
this._parent.resizeBox(300,300);
loadMovie("macrofade4.swf",_root.empty);
}

Here's the fla and a test swf u guys if u wanna take a look at it

Thanks....

Forgot to say that the fla is really a fla created by petefs posted here to guid in tweening/easing.I just wanna lern the way to load the swf's and take no credit for the example (maybe my shitty macro swf)

photopatrick
05-17-2004, 02:58 PM
Maybe I should be more exact.
I wanna create a"empty mc to load my swf's in and give it different x and y cordinates depending on what swf I wanna load since they will be different sizes etc.

ex

on(release) {
this._parent.resizeBox(300,300);
loadMovie("macrofade4.swf",_root.empty);
// and empty xposition empty yposition//
}

So I know how to create a "empty"mc on the main frame but not the function(action) that tells where the x and y values should be when swfno2 loads.
And when a different swf (for ex swf3 loads) I want that to load at a different x and y value.

So I wanna use the same mc just but direct it to different locations depending on what swf I wanna load.

Does this make sence ????

photopatrick
05-18-2004, 12:48 AM
Ok.solved it.

on(release) { this._parent.resizeBox(300,300);
loadMovie("macrofade4.swf",_root.empty);
setProperty ("_level0.empty", _x, 50);
setProperty ("_level0.empty", _y, 30);
}

So now I ned to figure out how to hold the laodMovie action untill the tweening is finished.

Any ideas about this?

issamneo
05-18-2004, 05:43 AM
declare a var i i=1

on(release) { this._parent.resizeBox(300,300);
i+=1;
loadMovie("macrofade4.swf",_root.empty);
setProperty ("_level0.empty", _x +(50*i), 50);
setProperty ("_level0.empty", _y, 30);
}

and continue with _y like you want

photopatrick
05-18-2004, 06:23 AM
ehhr maybe I'm as stupid as somebody who dont get 1+1=2,but could u tell me where do I declare the "var i=1" ????and what will it do??

I have a od way of learning stuff by starting at the end going back sometimes.(should learn more basic as).But like when u were in school u didn't learn enything until u understod u needed that knowledge to do something u really wanted.So here I am wanting to learn but maybe not in the right order...

Yes the Matrix got me.

issamneo
05-18-2004, 06:29 AM
the i var will be like a counter this mean each time you enter to the onrelease section i will be i=1 then i=2 etc.
and the x position will be 50,100,150 etc.
have you understand what it will do
and declare i in the begin of your as on the _root timeline or see how to declare global variable in any web site learning as

photopatrick
05-18-2004, 06:51 AM
Got the message.understod it and thanks..

I'm cruising the web(mostly in this forum and the tutorials) the hole time.
And this is by all means the best one.

So when I find something I like I get motivated to learn how to make use of all those "variables"(so I can modify them to my needs) and things make more sence each time.
So bare with me me ,somethimes I might ask stupid questions but the answer will most likley be better than if I answered them myself.

issamneo
05-18-2004, 07:09 AM
helping you was funny

issamneo
05-18-2004, 07:10 AM
try to be here more times

issamneo
05-18-2004, 07:10 AM
try to be here more times :)

photopatrick
05-18-2004, 07:17 AM
I live here.hehe.
it's like this I sit down and try things over and over again(giving my brain som heavy bondage)and when my brain takes time out, then I give it some rest and ask my questions here.