1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
//
// Description:
// Simple Test
//
// Authors:
// Jonathan Shore <jshore@e-shuppan.com>
//
// Copyright:
// Copyright 2001 E-Publishing Group Inc. Permission is granted to use or
// modify this code provided that the original copyright notice is included.
//
// This software is distributed with no warranty of liability, merchantability,
// or fitness for a specific purpose.
//
import SWFAction;
import SWFBitmap;
import SWFButton;
import SWFDisplayItem;
import SWFFill;
import SWFFont;
import SWFGradient;
import SWFMorph;
import SWFMovie;
import SWFMovieClip;
import SWFObject;
import SWFShape;
import SWFSound;
import SWFText;
import SWFTextField;
//
// Simple SWF Test
//
//
// Notes
// -
//
public class Simple {
public static void main (String[] argv)
throws Exception
{
SWFShape s = new SWFShape ();
// do fill (red)
SWFFillI f = s.addSolidFill (0xff, 0x00, 0x00, 0xff);
s.setRightFill (f);
// create box
s.movePenTo(-500,-500);
s.drawLineTo(500,-500);
s.drawLineTo(500,500);
s.drawLineTo(-500,500);
s.drawLineTo(-500,-500);
// add box to movie clip
SWFMovieClip clip = new SWFMovieClip ();
SWFDisplayItemI Bitem = clip.add(s);
Bitem.setDepth(1);
clip.nextFrame();
// rotate item 15 degrees over 5 frames
for (int n = 0; n < 5; n++) {
Bitem.rotate (-15);
clip.nextFrame();
}
// create movie
SWFMovie movie = new SWFMovie();
movie.setBackground(0xff, 0xff, 0xff);
movie.setDimension(6000,4000);
// add movie clip to main movie and position
SWFDisplayItemI Citem = movie.add (clip);
Citem.setDepth(1);
Citem.moveTo(-500,2000);
Citem.setName("box");
// actions
movie.add(new SWFAction ("/box.x += 3;"));
movie.nextFrame();
movie.add(new SWFAction ("gotoFrame(0); play();"));
movie.nextFrame();
// save to file
movie.save ("simple.swf");
}
};
|