Archive for the ‘Actionscript 3’ Category


Creating FXG-Library Elements at runtime in Flex 4 (Gumbo)

May 28, 2009. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 2 Comments »
Keywords: , , , , , , ,

Part of the FXG 1.0 specification in Flex 4 makes it possible to define elements inside a library. The elements can then be re-used in a FXG document:

<!--Library with the definitions -->
<Library>
   <Definition name="circle">
	<s:Ellipse x="0" y="0" width="100" height="100" >
	   <s:fill>
		<s:SolidColor color="0x000000" />
	   </s:fill>
	</s:Ellipse>
   </Definition>
</Library>
 
<!-- use some instances of the definition  -->
<circle/>
<circle x="200" y="100"/>
<circle x="300" y="100" height="75" width="75" />

As of now there is no way to create these symols at runtime. For example, if you’d like to create a starfield, you would need (more…)


Skinning and creating custom rating component in flex 4 (Gumbo)

Here’s a simple rating component done in Flex 4 (Gumbo).

The skin uses two library definitions. One symbol for the active and one for the passive rating. The symbols are then placed in a passive and an active Group. A mask is used to show/hide the active group based on the rating. ActiveGroup/passiveGroup and mask are the required Skin-Parts.

The Component itself manages the rating and pushes this down to the mask by setting its width. The rating is exposed as a bindable property.

The following example usees the component with two different skins.

source is here (SDK 4.0.0.4932)


Custom Component in Flex 4 (Gumbo). A Knob Button - part 2.

February 26, 2009. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 1 Comment »
Keywords: , , , , , , , ,

This post looked at creating a custom flex 4 component from scratch. The knob button defined there had a min/max-value for the range and the rotation. The user could adjust the value by pressing the knob and then dragging the mouse. Now, we would like to extend the control a bit by adding a text input-field where the value of the knob is reflected. Likewise a value can be entered into the textfield and the rotation of the knob would reflect this.

Instead of extending the knob I decided to create another control that is a composition (more…)


Custom Component in Flex 4 (Gumbo). A Knob Button - part 1.

February 26, 2009. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 11 Comments »
Keywords: , , , , ,

In this and this post I had a look at skinning components in Flex 4. Here I had a go at creating a simple custom component in Flex 4 (Gumbo) from scratch. The goal was to create a simple knob-button like those found on many softsynths.

The user clicks the button and drags the mouse to adjust the value. The advantage of a knob compared to a slider is that it needs much less screen estate and could be more intuitive in specific contexts to control a value.

Custom Knob Component

click here to view the demo. Full source at the end of this post.

Creating a custom visual component in Flex 4 is similar to the procedure in Flex 3 but states and skins are handled differently (in a much better and cleaner way). Basically we need to (more…)


Pixelshifting Session

September 24, 2008. Posted by Andy Hulstkamp in Actionscript 3, Flash. No Comments »
Keywords: , , , , ,

Shifting pixels in flash is relaxing. I experimented a bit with turning Type into grains and use these grains to mess around. What came out doesn’t make too much sense in terms of usability. Nevertheless someone might find it useful in a preloader to gain the attention from a user for just a few seconds more. Depending on the settings the effect generates different results:

Football Ground

click here to turn lovely Wembley grass into a 4th division pitch.

 

Investment Bank

click here to see what happened to Lehman, Merrill, Goldman, Morgan et. al.

 

Waterfall

click here for some bubbling pixels.

The code is not too exciting. Basically it (more…)


Neat little volvoxes

September 19, 2008. Posted by Andy Hulstkamp in Actionscript 3, Art, Astro (Flash 10 beta), FXG. No Comments »
Keywords: , ,

Yet another byproduct of a drawPath() test. Think those little creatures look neat, so I posted them here. Click here. Needs Flash 10 (beta rc1).

pulsating cells


Turning that Gumbo VSlider into a MixerSlider

September 19, 2008. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 1 Comment »
Keywords: , ,

Today I had a closer look at the new skinning architecture of Gumbo. Here’s a little example that uses a couple of custom slider components. This custom component extends the standard gumbo VSlider by composition and integrates custom skins. click here to see example. Needs flash player 10 (beta rc1).

Gumbonent Example

The Gumbo VSlider expects (more…)


27 flowers. Testing drawPath() in flash player 10 (beta)

September 16, 2008. Posted by Andy Hulstkamp in Actionscript 3, Art, Astro (Flash 10 beta). 1 Comment »
Keywords: , ,

I’ve been playing a bit with the new drawPath() function in flash 10 beta. Handy little function that offers better performance compared to iterating over lineTo(), curveTo() etc. Here’s a little byproduct. Just a simple algorithm that draws a series of lowers. Needs flash player 10 (beta rc1).

27 flowers

click here. Needs flash player 10 (beta rc1).


From cacophony to music. Trying to create bearable evolving music in flash 10 (beta).

September 15, 2008. Posted by Andy Hulstkamp in Actionscript 3, Astro (Flash 10 beta), Sound. 3 Comments »
Keywords: , ,

In this post I was experimenting with waveforms. Playing sounds constantly on the same pitch gets a bit boring after a while, however simply introducing random pitch isn’t too charming either. I started to twiddle (more…)


Sound in Flash 10 (beta). Generating Waveforms, Timbre and Pitch.

September 12, 2008. Posted by Andy Hulstkamp in Actionscript 3, Astro (Flash 10 beta), Flash, Sound. 32 Comments »
Keywords: , , , ,

It’s been quite a while (back in 2002, flash 5) since I did some serious work using oscillators and waveforms. I’m writing this down while trying to get back on track. The stuff described here is definitely no secret. It’s basic, but relevant to create some tunes in flash. Maybe you’ll find some of the stuff useful.

Through the introduction of the SampleDataEvent (more…)