I’ve been trying to convert some flash 5 code to MX but have failed in getting it to work in MX. I’ve been on trying to convert the sticky button code from mjau-mjau but with no success.
You can download from
http://www.mjau-mjau.com
http://www.sintax321.com/sticky.zip
If some one could please convert this code to work in MX it would be greatly apprecitated.
system
April 1, 2003, 11:33pm
4
i try to expoet it in MX and it stops working for me. Are your publish settings for MX or 5?
system
April 1, 2003, 11:34pm
5
the only thing I can suggest is changing the variable number to nNumber or something else because it could cause a conflict. Also wherever you have Movieclip change it to MovieClip with a Capital C.
system
April 1, 2003, 11:34pm
6
K ya i caought the Numkber thing but not the MC thing. I’ll play some more
system
April 1, 2003, 11:35pm
7
ahhh i see… ok, i’ll take a look…
system
April 1, 2003, 11:42pm
8
nah, I have no idea. the code looks fine to me… I’ll keep at it, but I can’t promise anything…
system
April 1, 2003, 11:43pm
9
Ya i thought it looked good to. I changed the Number and the MovieClip thing and still it does nothing. I can’t notice muc hthat would cause it not to work. I was hoping a code monkey like LIB or POM would take a look at it but they are no where to be found so far. I’ll keep looking to. thanks for trying so far.
system
April 1, 2003, 11:59pm
10
Hmm… this is what I got out of it.
playamarz :player:
system
April 2, 2003, 12:21am
11
same thing playamarz… change the version to flash 6 in the publish settings and it doesn’t work :-\
system
April 2, 2003, 12:32am
12
Yeah, it doesn’t work for me either, but all the coding looks A OK in my book.
Hmm, interesting.
system
April 2, 2003, 12:34am
13
it may have something to do with using all of those _parent and such. I’m sure the problem is that one single thing is being called incorrectly and that caused everything not to work…
system
April 2, 2003, 12:37am
14
yeah… it’s an addresing problem =)
accel = .8;
convert = .2;
MovieClip.prototype.sticky_load = function(menunumber) {
mysound = new Sound(this);
this._parent.released = 0;
somenumber = menunumber;
iterations = 5;
xstart = this._x;
drag = 0;
ystart = this._y;
targetx = xstart;
targety = ystart;
r = 5;
x = (2*Math.PI)*(somenumber/iterations);
t = Math.tan(x);
mycol = new Color(this.internal);
this._parent.drag = 0;
};
MovieClip.prototype.sticky_update = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && this._parent.drag<2 && this._parent.released == 0) {
if (!Math.floor(Math.random()*5)) {
counter++;
addcol = Math.round(Math.random()*151);
mycol.setTransform({rb:addcol, gb:addcol, bb:addcol});
duplicateMovieClip(this.line0, "line"+counter, counter);
}
deltax = this._parent._xmouse-xstart;
deltay = this._parent._ymouse-ystart;
targetx = (_root._xmouse-deltax/r);
targety = (_root._ymouse-deltay/r);
if (!drag) {
mysound.attachSound("sound7");
mysound.start();
this.swapDepths(2);
drag = 1;
this._parent.drag++;
}
} else if (!this._parent.released) {
this._parent["inhead"+(somenumber+1)]._visible = 1;
mycol.setTransform({ra:100, ga:100, ba:100, rb:0, gb:0, bb:0});
targetx = xstart;
targety = ystart;
if (drag == 1) {
this.swapDepths(0);
drag = 0;
this._parent.drag--;
}
} else {
targety = -170;
targetx = (t*85)-56;
if (this._parent.trigger == 1) {
this.removeMovieClip();
}
}
xpos = xpos*this._parent.accel+(targetx-this._x)*this._parent.convert;
this._x += xpos;
ypos = ypos*this._parent.accel+(targety-this._y)*this._parent.convert;
this._y += ypos;
};
MovieClip.prototype.sticky_press = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
r = 10;
}
};
MovieClip.prototype.sticky_release = function(subname) {
if (!_root.pause) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this._parent.atext = subname.toUpperCase();
this._parent.released = 1;
this._parent.label = subname;
this._parent.atext = subname.toUpperCase();
this._parent.gotoAndPlay(this._parent._currentframe+1);
}
}
};
system
April 2, 2003, 1:28am
16
so if i just re address it like kax has done it should work?
system
April 2, 2003, 1:45am
17
ok so i tried out kax’s code and it kind of worked but not. The icon moved a little but then went still. any ideas?
system
April 2, 2003, 6:49am
18
LIB, POM SOME ONE PLEASE HELP. I have no clue how to change this code. i never worked with AS really untill i got MX any body i’m dying here:*(
system
April 2, 2003, 6:51am
19
Im trying buddy, but I just don’t see whats wrong. Perhaps its something right in front of me, but all of the syntax, addressing, and coding look correct to me, I dont understand why it won’t work.
system
April 2, 2003, 8:48am
20
I got it working correctly with my system… I erased some ;'s Which caused some problems but that’s it…
Hmm… I dunno… it did everything fine for me guys…
playamarz :player: