A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: what's wrong with this script???

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131

    what's wrong with this script???

    hello people,

    i can't find what's wrong with this script.
    run it and look.

    Code:
    drawNews = function(){
    	totalbloks = 3; 
    _root.createEmptyMovieClip("news", 7);
          
    		//title bar
    		_root.news.beginFill (0x666666, 100);
    		_root.news.moveTo (100, 32);
    		_root.news.lineTo (100, 32);
    		_root.news.lineTo (100, 52);
    		_root.news.lineTo (300, 52);
    		_root.news.lineTo (300, 32);
    		_root.news.endFill();
    		//content bg
    		_root.news.beginFill (0xcccccc, 100);
    		_root.news.moveTo (100, 52);
    		_root.news.lineTo (100, 52);
    		_root.news.lineTo (100, 152);
    		_root.news.lineTo (300, 152);
    		_root.news.lineTo (300, 52);
    		_root.news.endFill();
    	
    
    	   
    	   var xPos = _root.news._y;
    var w = _root.news._height;
    //created news more blocks...
    for (var i = 1; i<=totalbloks-1; i++) {
    duplicateMovieClip("_root.news", "newsMC"+i, i+20);
    _root["newsMC"+i]._y = (xPos+w+10)*i;
    
    _root["newsMC"+i].onRollOver = function(){	
    	_root["newsMC"+i].beginFill (0x222222, 100);
    		_root["newsMC"+i].moveTo (100, 32);
    		_root["newsMC"+i].lineTo (100, 32);
    		_root["newsMC"+i].lineTo (100, 52);
    		_root["newsMC"+i].lineTo (300, 52);
    		_root["newsMC"+i].lineTo (300, 32);
    		_root["newsMC"+i].endFill();
    }
    }
    	   clearInterval(drawNewsfunc);
    }
    drawNewsfunc = setInterval( drawNews, 500);
    on roll mover they each should change color.
    please help!!

    thanx

    grafx

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131
    i found one solution.

    Code:
    drawNews = function(){
    	totalbloks = 3; 
    _root.createEmptyMovieClip("news", 7);
          
    		//title bar
    		_root.news.beginFill (0x666666, 100);
    		_root.news.moveTo (100, 32);
    		_root.news.lineTo (100, 32);
    		_root.news.lineTo (100, 52);
    		_root.news.lineTo (300, 52);
    		_root.news.lineTo (300, 32);
    		_root.news.endFill();
    		//content bg
    		_root.news.beginFill (0xcccccc, 100);
    		_root.news.moveTo (100, 52);
    		_root.news.lineTo (100, 52);
    		_root.news.lineTo (100, 152);
    		_root.news.lineTo (300, 152);
    		_root.news.lineTo (300, 52);
    		_root.news.endFill();
    	_root.news.onRollOver = function(){	
    		this.beginFill (0x222222, 100);
    		this.moveTo (100, 32);
    		this.lineTo (100, 32);
    		this.lineTo (100, 52);
    		this.lineTo (300, 52);
    		this.lineTo (300, 32);
    		this.endFill();
    }
    	_root.news.onRollOut = function(){	
    		this.beginFill (0x666666, 100);
    		this.moveTo (100, 32);
    		this.lineTo (100, 32);
    		this.lineTo (100, 52);
    		this.lineTo (300, 52);
    		this.lineTo (300, 32);
    		this.endFill();
    }
    	   
    	   var xPos = _root.news._y;
    var w = _root.news._height;
    //created news more blocks...
    for (var i = 1; i<=totalbloks-1; i++) {
    duplicateMovieClip("_root.news", "newsMC"+i, i+20);
    _root["newsMC"+i]._y = (xPos+w+10)*i;
    _root["newsMC"+i].onRollOver = function(){	
    	this.beginFill (0x222222, 100);
    	this.moveTo (100, 32);
    	this.lineTo (100, 32);
    	this.lineTo (100, 52);
    	this.lineTo (300, 52);
    	this.lineTo (300, 32);
    	this.endFill();
    }
    _root["newsMC"+i].onRollOut = function(){	
    	this.beginFill (0x666666, 100);
    	this.moveTo (100, 32);
    	this.lineTo (100, 32);
    	this.lineTo (100, 52);
    	this.lineTo (300, 52);
    	this.lineTo (300, 32);
    	this.endFill();
    }
    }
    	   clearInterval(drawNewsfunc);
    }
    drawNewsfunc = setInterval( drawNews, 500);
    any other/shorter/better solutions?

    grafx

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Location
    Holland - Den Haag
    Posts
    131
    sorry, thought that the last reply didn't work..
    Last edited by grafx_one; 11-18-2002 at 04:32 PM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center