View Full Version : Making actions work inside of a MC
niksan8787
03-10-2009, 03:14 AM
Hello,
I've been having this problem since i realized I have to use my already working stuff inside of a MC symbol. The code is too much for me to post it here because it is placed on several key frames in the time line. It also consits of other mc symbols inside of it called by code.
So if someone can please explain me what I should do to make it work when I place the symbol in the time line, I'd really appreciate it!!!
Thank you!
niksan.
niksan8787
03-11-2009, 01:53 AM
no answer:?
niksan8787
03-11-2009, 02:13 AM
var dotList = new Array('Viale Abruzzi', 'Viale Dei Mille', 'Viale Umbria','Viale Romagna','Viale Campania','Viale Molise','Corso 22 Marzo','Viale Corsica','Viale Emilio Caldara','Viale Bianca Maria','Via Gaio');
// adjust this number to change how far you have to be from the clip to turn on the toolTip
var checkDistance = 80;
//
for (var i = 0; i < _root.dotList.length; i++) {
var mc = _root['str' + i];
mc.dragToolTip = false;
mc.createEmptyMovieClip('toolTip', 0);
mc.toolTip._rotation = -mc._rotation;
mc.toolTip._alpha = 0;
_root['str' + i].toolTip.createTextField("ct", 0, 0, 0, 30, 30);
with (_root['str' + i].toolTip.ct) {
_x = -2;
_y = 12;
antiAliasType = "advanced";
gridFitType = "subpixel";
autoSize = true;
embedFonts = true;
selectable = false;
text = _root.dotList[i];
var f = new TextFormat();
f.color = 0x000000;
f.font = "myFont";
f.size = 12;
setTextFormat(f);
}
mc.onRollOver = function() {
this.dragToolTip = true;
};
mc.onRollOut = function() {
this.dragToolTip = false;
};
mc.onEnterFrame = function() {
if (this.dragToolTip) {
var mc = this.toolTip;
mc._x = this._xmouse;
mc._y = this._ymouse;
}
};
}
//
_root.onMouseMove = function() {
if (_level100 != undefined) {
return;
}
for (var i = 0; i < _root.dotList.length; i++) {
var mc = _root['str' + i];
var dist = getDistance(mc._x, mc._y, _root._xmouse, _root._ymouse);
if (dist < checkDistance) {
mc.toolTip._alpha = 100 * ((checkDistance - dist) / checkDistance);
} else {
mc.toolTip._alpha = 0;
}
}
updateAfterEvent();
};
this is just an isolate example of the script that works on the timeline but it doesn't when placed inside of a MC
niksan8787
03-12-2009, 10:19 PM
hi,
really nobody knows how to so it:?!
niksan8787
04-25-2009, 11:34 PM
can somebody check if they can help me ?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.