Flash / Actionscript

Soldato
Joined
10 Apr 2006
Posts
7,890
Location
North West
I seem to be busy on these forums asking people questions!

Every little helps though :)

I have a library full of movie files and navigation buttons that are movie clips.

When a navigation button is pressed the follow code is ran :

this.onRelease = function() {
_root.attachMovie("Entrance", "VideoClip", 1);
_root.VideoClip._x = 17;
_root.VideoClip._y = 17;
};

The movieclip Entrance is then played.
At the end of that movie clip, another navigation button is placed. it has the exact same code except Entrance is changed for another moviename.

All the movies play fine, so they are linked properly.
But the first time the button is pressed, the VideoClip is moved 17px on both axis, but when the second button is pressed the VideoClip plays from 0,0(top left corner) and ignores the alignment I have set.

Any idea why as I need all the movie clips to be playing in the same area!

Thanks!

if anyone finds it easier to help via MSN then please add me :)
 
what i'd do is have an empty mc in the root for the 'VideoClip' to be loaded into.. that way _x and _y only need setting the once.

Code:
//root timeline
this.createEmptyMovieClip("mcHolder", this.getNextHighestDepth);
with (mcHolder) {
	_x = 17;
	_y = 17;
}

Code:
//button
this.onRelease = function() {
_root.mcHolder.attachMovie("Entrance", "VideoClip", 1);
};

although i'd rather give the button an instance name (say btnEntrance) and put the button code on the root timeline changing this.onRelease to btnEntrance.onRelease
 
thanks a lot, ill try the last one now!

I managed to get it working for a while but now its gone funny again so hopefully the last one will work.

Each movie i put on has to go 1 level higher?

So 1 then 2 then 3 etc?
 
if you load an mc to a level with content on the stage, that content will be removed but if you want the existing content to remain, then you load onto a higher/empty level.

i gessed you wanted to swap the mc's, Entrance mc being like a page in a book to be replaced by another mc when a nav button is clicked. if i was right there, use the same level else assign them a one each, 1,2,3 ect..

3:20am i'm due to crash-out.. :o

if you have no joy, email me the fla and i'll have a look during the day when i'm more awake..
 
Last edited:
thanks a lot, emailing you now about it :)

email bounced?

email me if possible so i can forward the file to you


tom[@]tomsinclair[dot]co[dot]uk
 
Last edited:
just load them movies in the Container movie clip that u put on the stage. That way they all be placed on (0,0) of the container clip. you can place your container clip anywhere on the stage... nJoy!
 
tsinc80697, i just emailed back a slightly modified fla.. i think to get it any better in alignment it's going to need some of the mc's being redone. also it's going to need some ActionScript to deal with the animating buttons.

as i say in the email, i'll have another look after i help the folks..

edit: 8:30, about to send a rebuilt version. it's all working but it's missing an animation, so i used a copy of room2 reverse. it'll just need that copied mc editing to include the animation of leaving room1.. :cool:
 
Last edited:
hey just got back in now, long day!

you got MSN by any chance ? just got a few small questions that need asking if you have any time!

Emailed you back a few minutes ago aswell


Thanks for the help!
 
no worries chap, i'm afraid i don't use MSN but feel free to email me any questions or ask here, i'm easy. :)

and just got your email, the 2nd version has got a partial preloader (non-visual), i unchecked export to first frame on the export mc's and dumped them onto the stage in a place that never gets shown (frame 2, lowest layer). first frame is 60bytes, 2nd frame 2mb.

to make it visual it either needs a textfield or some wee animation, perhaps both. if you need some help with it, i'll be about :)
 
Back
Top Bottom