# 5 to MX code conversion

**URL:** <https://forum.kirupa.com/t/5-to-mx-code-conversion/17132>\
**Category:** flash\
**Created:** [April 1, 2003, 7:22pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132 "2003-04-01T19:22:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sintax321](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sintax321](https://forum.kirupa.com/u/sintax321)\
**Post date:** [April 1, 2003, 7:22pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/1 "2003-04-01T19:22:36Z")

</div>

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.mjau-mjau.com)  
[http://www.sintax321.com/sticky.zip](http://www.sintax321.com/sticky.zip)

If some one could please convert this code to work in MX it would be greatly apprecitated.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:30pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/2 "2003-04-01T23:30:02Z")

</div>

–\>BUMP\<–

Any body out there?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:32pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/3 "2003-04-01T23:32:02Z")

</div>

its in MX for me…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:33pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/4 "2003-04-01T23:33:04Z")

</div>

i try to expoet it in MX and it stops working for me. Are your publish settings for MX or 5?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:34pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/5 "2003-04-01T23:34:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:34pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/6 "2003-04-01T23:34:41Z")

</div>

K ya i caought the Numkber thing but not the MC thing. I’ll play some more

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:35pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/7 "2003-04-01T23:35:37Z")

</div>

ahhh i see… ok, i’ll take a look…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:42pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/8 "2003-04-01T23:42:03Z")

</div>

nah, I have no idea. the code looks fine to me… I’ll keep at it, but I can’t promise anything…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:43pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/9 "2003-04-01T23:43:57Z")

</div>

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.🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 1, 2003, 11:59pm UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/10 "2003-04-01T23:59:37Z")

</div>

Hmm… this is what I got out of it.

playamarz :player:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 12:21am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/11 "2003-04-02T00:21:27Z")

</div>

same thing playamarz… change the version to flash 6 in the publish settings and it doesn’t work :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 12:32am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/12 "2003-04-02T00:32:55Z")

</div>

Yeah, it doesn’t work for me either, but all the coding looks A OK in my book.

Hmm, interesting.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 12:34am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/13 "2003-04-02T00:34:07Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 12:37am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/14 "2003-04-02T00:37:36Z")

</div>

yeah… it’s an addresing problem =)

```auto
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);
		}
	}
};

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 12:55am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/15 "2003-04-02T00:55:10Z")

</div>

figures…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 1:28am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/16 "2003-04-02T01:28:16Z")

</div>

so if i just re address it like kax has done it should work?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 1:45am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/17 "2003-04-02T01:45:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 6:49am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/18 "2003-04-02T06:49:42Z")

</div>

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:\*(

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 6:51am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/19 "2003-04-02T06:51:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 8:48am UTC](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132/20 "2003-04-02T08:48:12Z")

</div>

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:

[Next page](https://forum.kirupa.com/t/5-to-mx-code-conversion/17132.md?page=2)
