Friday, 4 March 2011

MVC part 2

This week I have worked on my frame design and the set  of frames i'll be using in my application.
Once the image has been captured it's time for some action.

Firstly, I have created an XML file, where I've stored my frames by name & url. Then I proceded to load my xml file from the beginning of the application (Main.as).

Then, within the CaptureView, I have created a loop containing 7 buttons (each one of them for each of the frames previously stored on my XML). When clicking each one of the buttons, this data is sent to my controller (where I keep a 'switch case'). Depending on the button clicked, a string is then passed to the controller and this references the model, where there is a function that sets the frame string and dispatches an Event that the CaptureView class listens for and updates the frame through a function that contains a switch case that adds each frame on the stage.

The problems I've had throughout this process were to retrieve each one of the button's names (in the loop). This was done by creating a document class for these button(s), where there's a function that returns the button's name (String). By calling this function it retrieves the name of the frame, so that this one is then ready to be sent to the Controller.

appController.frameControl(e.currentTarget.fName);

My second issue was to get rid of an added frame when clicking on any other frame button. 
To resolve this I have added an if statement within my updateFrame function. This means if a frame has been added onto stage, in order to preview another one, any frame must be non-existent, so this removes any frame already on stage, leaving space for a new one.

                        if(current_frame)
{
removeChild(current_frame);
current_frame = null;
}

 I am now working on loading my filters, so that I can add them in little icons for the user to utilize them. The next step will the the merging of the frame+image and filter, to be ready for encoding!

Photorama is looking like this:
(Please note the graphics are not quite finished!)






No comments:

Post a Comment