René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Mouse click [Ming wrapper example] | ||
This example demonstrates how dragging can be activated with the OnMouseDown event.
You will notice that the mouse needs not necessarly be pressed over the blue rectangle in order to move it. Pressing the mouse button anywhere within the movie's
area will move the rectangle.
This flash movie was created with the following program. MouseClick.cpp
#include "SWFMovie.h" int main() { Movie movie("MouseClick.swf", 400, 400); Shape shape; shape.LineStyle(2, 0, 0, 0); shape.FillStyle(40, 50, 180); shape.MoveTo(20, 20); shape.Line( 100, 0); shape.Line( 0, 100); shape.Line(-100, 0); shape.Line( 0,-100); MovieClip clip; DisplayItem iShape = clip.Add(shape); iShape.Name("s"); clip.NextFrame(); DisplayClip iClip =movie.Add(clip); iClip.Name("c"); iClip.OnMouseDown("this.startDrag();"); iClip.OnMouseUp ("this.stopDrag ();"); movie.NextFrame(); return 0; } This is one of a series of examples that demonstrates the C++ ming wrapper classes. Other examples can be found here.
|