Jump to content

Transparency loading grid


legacy800

Recommended Posts

Hello,I'm getting a bit more into flash again, and I saw a flash website that I would like to recreate in a way.Gonna post this on multiple forums to see if I can fully recreate an effect as in this sample:http://www.web-site-template.net/templates/300110629Now i'm looking for someone with a bit of experience in flash who can tell me a bit more about how to achieve such an effect.What i've already done is make a mask for the photo to get the grid effect.Now I want to get the loading effect, looking at a single box in the grid I already see there are 3 parts in that.First it seems to load the picture itself, than it seems to load 2 transparency boxes over it.With the next state always iniating when one state fully fills a box.Now I know how this could be made using a single gridbox, but how with one go about making the effect random and using so many gridboxes?If anyone would have a tutorial for this kind of random effect, it would help me out alot.Not trying to be lazy here and let other people do the work by the way, just trying to figure this out fast while doing my own research. :)Greetings,Stephan

Link to comment
Share on other sites

Masking the picture fully with a large static grid seems like a bad idea now since each gridblock has it's own random loadinganimation, meaning i have to make each gridblock into a movieclip.I have succesfully done this by using this actionscript:

var ph:MovieClip = new MovieClip();addChild(ph);var xPos:Number = 0;var yPos:Number = 0;var margin:int = 2;for(var i:int = 0; i<54; i++){	var myBox:Box = new Box();	if(xPos + myBox.width  > stage.stageWidth)	{		yPos += myBox.height + margin		xPos = 0;	}	myBox.y = yPos;	myBox.x = xPos;	ph.addChild(myBox);		xPos += myBox.width + margin;}ph.x = (stage.stageWidth/2) - ph.width/2;ph.y = (stage.stageHeight/2) - ph.height/2;

Putting this on a layer will draw the grid with boxes over the stage fully centered.Because this is done using actionscript, can someone tell me how to mask a picture on a layer below my actionscript layer.I know how to do a normal mask, but because this is being generated by actionscript how can you mask it than?Because I am pretty new to actionscript I am not even sure the myBox movieclips are being put on the same layer as the actionscript, can anyone confirm this?Greetings,Stephan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...