Actionscript 3 code

  • Posted
  • Proposals 7
  • Remote
  • #33804
  • Expired
Clark S.Mehdi A.Marianne B.Benjie M.NARESH K. + 2 others have already sent a proposal.
  • 0


Experience Level: Expert
Below details how the flash timeline actionscript will link to the modules and the variables required to send through to it. The attached File 'possibleResults.gif' shows a possible solution returned from the code following inputting the below variables.

//the stage properties array
var stageArray = new Array();
//set the stage properties
var canvasWidth:int = 50;
var canvasHeight:int = 50;
//add to it the stage properties array
stageArray.push(canvasWidth, canvasHeight);

//set the rectangles min and max properties array
var rectPropArray = new Array();
//set the rectangle min max properties
var minRectWidth:int = 10;
var minRectHeight:int = 10;
//add it to the rectangle properties array
rectPropArray.push(minRectWidth, minRectHeight);
//i.e the above states that the rectangles height
//or width must be greater than 10 pixels, this must be
//adjustable i.e. I could change this to 20 and 20 and
//it would still work.

//set an array to store the rectangles areas
rectsAreasArray = new Array(800,900,200,600);

//from this point on create the code to provide the
//output as detailed in the attachment.
//i.e. something like...
new createAndDivideAreaIntoRectangles(stageArray, rectPropArray, rectsAreasArray)

//the code must also accomodate between 2 and 10 rectangles
//being input.t should also take less than 10 secondes to
//provide the arrangement, 15 seconds max.

//If an arrangement is simply not possible, due to the minRectWidth and
//minRectHeight making it impossible it should do
//a trace stating this is the case.

Again, this must be produced using classes and objects, best practice adhered to. Please do not quote for this if you're a timeline coder or don't have an ADVANCED LEVEL of AS3 coding.



Need Flash AS3 coding produced to provide the following functionality...

Take a given number of rectangles, between 1 and 10, and position them in such a way that they fit within a given area. The sum area of the rectangles combined equals the given canvas area. The width and heights of the rectangles are not specified and can be defined by the code as long as they meet the required area for that rectangle. For example....

4 rectangles with the following areas to be arranged within a space measuring 200mm x 200mm (40,000 mm squared)...

Rectangle 1, 15000 mm squared
Rectangle 2, 8000 mm squared
Rectangle 3, 12000 mm squared
Rectangel 4, 5000 mm squared

Total area of the rectangles = 40, 000 mm squared.

The code must be produced using AS3 classes, (not the timeline), with the classes produced to best practice i.e. carrying out single function, that when connected produce the overall results required).

Clarification Board

    There are no clarification messages.