I am developing ActionScript 3.0 app for the Blackberry Playbook.
I get an image.
I want to show another image in one place when the user clicks on this image.
How can I do this? I want to transition between these two images. The second image will be 0 alpha to 100 alpha.
It all depends on the transition you want. For simple alpha, you can go through the Trienor engine like Eriot has been suggested, or you can make yourself a bit simpler.
Simple : Basically, when you click on the image, the load is loaded (or already loaded) in the next one. Start an anti-programmer listener to load it. Something like this: slightly more complex : check the bitmap data square and merge it with
// We believe that "image2" is another image and it has a false view of alpha // 0.0. "Image1" is the first image and currently // // click on image for image handler Personal Function _onImageClick (e: MouseEvent): Add an entry frame in zero {// step - I'm assuming you // via Use this from This stationation. This.stage.addEventListener (Event.ENTER_FRAME, this._onEnterFrame); // Let's see our second image so that we can pull it out. Image2.visible = true; } // Each frame designates the personal function _onEnterFrame (E: Event): Zero {// image2 The second image is this.image2.alpha + = 0.05; // If you fade slow (this.image2.alpha> = 1.0) {this.image2.alpha = 1.0; // hide the image first this.image1.alpha = 0.0; This.image1.visible = false; // Insert Frame Event Listener This.stage.removeEventListener (Event.ENTER_FRAME, this._onEnterFrame); }}
() or
pixelDisolve () < / Code> Function:
Comments
Post a Comment