Thursday, 13 February 2014

Colour Picker on the Canvas

Once I managed to achieve some functionality on the canvas I decided to attempt the colour picker tool in order for users to be able to choose a colour to draw with. In order to do so I followed various tutorials on action script and Flash but just like the canvas implementation I came across many errors and conflicts. 


Within the image below the functions had a conflict where they did not have a body, this was resolved by using curly brackets for each of them. As you can see something as simple as a missing curly brace can affect the code and overall functionality. 


Within the code I created an actionscript file where I have created a Bindable selecting specific colours that I have mentioned. I chose specific colours as I was testing out the code there wasn't a specific reason why I wanted just a small set. 


Within the mxml document I imported the action script file, in order for the bindable to run within the application. 


Final Canvas Output
Below I have displayed the final output of my canvas as you can see the overall function works, users are able to draw doodles. 



The image below displays the colour picker once the user has selected it, as you can see I have provided a large range of colours. Unfortunately the code implemented does not apply the colour change that the user has selected therefore the colour picker is not fully functional at this stage. 



After trial and errors I have been unsuccessful in completing the draw canvas to my original expectations as only one colour is functional at this time. I was able to change the line colours within the back end code therefore not being useful to the user as they cannot change the colour themselves. I feel that the functionality is there I am just missing a minor section that links the canvas and colours picker in order for them to work together. 



Sources
Adobe.com. n.d. Adobe Edge: February 2010 - Getting started with Adobe Flash Builder 4. [online] Available at: http://www.adobe.com/inspire-archive/february2010/articles/article2/index.html [Accessed: 11 Feb 2014].

Blogs.adobe.com. 2010. Spark DateField and ColorPicker. [online] Available at: http://blogs.adobe.com/aharui/2010/01/spark_datefield_and_colorpicke.html [Accessed: 9 Feb 2014].

Codebabble.com. 2014. Customizing a Flash Builder component. [online] Available at: http://codebabble.com/flash-builder/customizing-a-flash-builder-component [Accessed: 9 Feb 2014].

No comments:

Post a Comment