Results 1 to 5 of 5

Thread: Making actions work inside of a MC

  1. #1
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Making actions work inside of a MC

    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.

  2. #2
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    no answer:?

  3. #3
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    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
    Last edited by Snookerman; 04-26-2009 at 08:06 PM. Reason: added [code] tags

  4. #4
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi,

    really nobody knows how to so it:?!

  5. #5
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can somebody check if they can help me ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •