-
load button to certain x, y position???
hi guys,
Code:
stop();
this.createEmptyMovieClip("flag1holder", this.getNextHighestDepth());
flag1holder.createEmptyMovieClip("flag1container",this.getNextHighestDepth());
flag1holder.flag1container.attachMovie("BUTTflag1");
flag1container._x=10;
flag1container._y=10;
break;
}
yes this code doesn't work. i need to load a non-component button (BUTTflag1) and i want it to load at a defined position on the stage. i would prefer it didn't have to be loaded into movieclips, but if thats what it takes then ok cool.
please please please help guys, i know this is probably elementary stuff.
thanks in advance!
James
-
Registered User
hi,
Some corrections to your code:
code:
this.createEmptyMovieClip("flag1holder", this.getNextHighestDepth());
flag1holder.createEmptyMovieClip("flag1container",flag1holder.getNextHighestDepth());
flag1holder.flag1container.attachMovie("BUTTflag1", "new_name", flag1holder.flag1container.getNextHighestDepth());
flag1holder.flag1container._x=10;
flag1holder.flag1container._y=10;
Attaching and positioning a movie clip (or button) is just:
code:
var temp_mc = this.attachMovie("my_mc","new_mc",this.getNextHigh estDepth());
temp_mc._x = 100;
temp_mc._y = 200;
-
FK'n_dog
try this method
Code:
ref1 = this.createEmptyMovieClip("r1", Depth++);
ref2 = ref1.createEmptyMovieClip("r2",Depth++);
init = {_x:100,_y:200};
ref2.attachMovie("BUTTflag1","BUTTflag1",Depth++,init);
/* this compiles as -
Variable _level0.Depth = 3
Variable _level0.ref1 = [movieclip:_level0.r1]
Variable _level0.ref2 = [movieclip:_level0.r1.r2]
Variable _level0.init = [object #1, class 'Object'] {
_y:200,
_x:100
}
Movie Clip: Target="_level0.r1"
Movie Clip: Target="_level0.r1.r2"
Movie Clip: Target="_level0.r1.r2.BUTTflag1"
*/
-
Registered User
If you're publishing for Flash Player 7 or later, you need to initialize variables. In this case, Depth:
code:
var Depth = 0; // for example
Using lowercase for variables is more usual:
code:
var depth = 0;
-
FK'n_dog
Hi Nunomira ..
still with MX6 here,
I will upgrade one day
-
Registered User
Didn't mention it, but I saw that in your signature - so it was not exactly for you, but for anyone else that reads this post
A good practice though, even if you're publishing for FP6!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|