forked from: massmedian challenge
メモ
画像のサイズは525x70
/**
* Copyright mtok ( http://wonderfl.net/user/mtok )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/tsjP
*/
// forked from checkmate's massmedian challenge
package {
import com.flashdynamix.motion.TweensyTimeline;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.system.LoaderContext;
import fl.motion.easing.*;
import com.flashdynamix.motion.Tweensy;
//メモ
/*
* 画像のサイズは525x70
*
*/
public class Massmedian extends Sprite{
//-------------------------------//
// Use properties as follows.
//-------------------------------//
private var _sliceList:Array;
private var _timeLines:Array;
private var _imgWidth:int = 525;
private var _imgHeight:int = 70;
private var _sliceHolder:Sprite;
private var _shadow:Bitmap;
private var _flag:Boolean = true;
private var hart:Array = [
172, 197, 163, 206, 157, 212, 151, 217, 147, 221, 143, 225, 140, 229, 137, 232, 134, 235, 131, 238, 128, 240, 126, 243, 123, 245, 121, 247, 119, 250, 117, 252, 115, 254, 113, 256, 111, 258, 109, 259, 107, 261, 106, 263, 104, 265, 102, 266, 101, 268, 99, 269, 98, 271, 96, 272, 95, 274, 93, 275, 92, 276, 91, 278, 89, 279, 88, 280, 87, 282, 86, 283, 84, 284, 83, 285, 82, 286, 81, 287, 80, 288, 79, 290, 78, 291, 77, 292, 76, 293, 75, 294, 74, 295, 73, 296, 72, 297, 71, 297, 70, 298, 69, 299, 68, 300, 67, 301, 66, 302, 66, 303, 65, 304, 64, 305, 63, 306, 62, 307, 62, 308, 61, 309, 60, 310, 59, 311, 59, 312, 58, 313, 57, 314, 56, 315, 56, 316, 55, 317, 54, 318, 54, 319, 53, 320, 53, 321, 52, 322, 51, 323, 51, 324, 50, 325, 50, 326, 49, 327, 49, 328, 48, 329, 47, 330, 47, 331, 46, 332, 46, 333, 45, 334, 45, 335, 44, 336, 44, 337, 43, 338, 43, 339, 43, 340, 42, 341, 42, 342, 41, 343, 41, 344, 41, 345, 40, 346, 40, 347, 39, 348, 39, 349, 39, 350, 38, 351, 38, 352, 38, 353, 37, 354, 37, 355, 37, 356, 36, 357, 36, 358, 36, 359, 35, 360, 35, 361, 35, 362, 35, 363, 34, 364, 34, 365, 34, 366, 34, 367, 33, 368, 33, 369, 33, 370, 33, 371, 33, 372, 32, 373, 32, 374, 32, 375, 32, 376, 32, 377, 31, 378, 31, 379, 31, 380, 31, 381, 31, 382, 31, 383, 31, 384, 31, 385, 30, 386, 30, 387, 30, 388, 30, 389, 30, 390, 30, 391, 30, 392, 30, 393, 30, 394, 30, 395, 30, 396, 30, 397, 30, 398, 30, 399, 30, 400, 30, 401, 30, 402, 30, 403, 30, 404, 30, 405, 30, 406, 30, 407, 30, 408, 30, 409, 30, 410, 30, 411, 30, 412, 30, 413, 30, 414, 30, 415, 30, 416, 30, 417, 30, 418, 30, 419, 31, 420, 31, 421, 31, 422, 31, 423, 31, 424, 31, 425, 31, 426, 32, 427, 32, 428, 32, 429, 32, 430, 32, 431, 32, 432, 33, 433, 33, 434, 33, 435, 33, 436, 34, 437, 34, 438, 34, 439, 34, 440, 34, 441, 35, 442, 35, 443, 35, 444, 36, 445, 36, 446, 36, 447, 36, 448, 37, 449, 37, 450, 37, 451, 38, 452, 38, 453, 38, 454, 39, 455, 39, 456, 40, 457, 40, 458, 40, 459, 41, 460, 41, 461, 42, 462, 42, 463, 42, 464, 43, 465, 43, 466, 44, 467, 44, 468, 45, 469, 45, 470, 46, 471, 46, 472, 47, 473, 47, 474, 48, 475, 48, 476, 49, 477, 49, 478, 50, 479, 51, 480, 51, 481, 52, 482, 52, 483, 53, 484, 54, 485, 54, 486, 55, 487, 56, 488, 56, 489, 57, 490, 58, 491, 58, 492, 59, 493, 60, 494, 61, 495, 61, 496, 62, 497, 63, 498, 64, 499, 64, 500, 65, 501, 66, 502, 67, 503, 68, 504, 69, 505, 70, 506, 71, 507, 71, 508, 72, 509, 73, 510, 72, 509, 71, 508, 70, 507, 69, 506, 68, 505, 68, 504, 67, 503, 66, 502, 65, 501, 64, 500, 63, 499, 63, 498, 62, 497, 61, 496, 60, 495, 59, 494, 59, 493, 58, 492, 57, 491, 57, 490, 56, 489, 55, 488, 55, 487, 54, 486, 53, 485, 53, 484, 52, 483, 51, 482, 51, 481, 50, 480, 50, 479, 49, 478, 48, 477, 48, 476, 47, 475, 47, 474, 46, 473, 46, 472, 45, 471, 45, 470, 44, 469, 44, 468, 43, 467, 43, 466, 42, 465, 42, 464, 42, 463, 41, 462, 41, 461, 40, 460, 40, 459, 40, 458, 39, 457, 39, 456, 38, 455, 38, 454, 38, 453, 37, 452, 37, 451, 37, 450, 36, 449, 36, 448, 36, 447, 35, 446, 35, 445, 35, 444, 35, 443, 34, 442, 34, 441, 34, 440, 34, 439, 33, 438, 33, 437, 33, 436, 33, 435, 32, 434, 32, 433, 32, 432, 32, 431, 32, 430, 31, 429, 31, 428, 31, 427, 31, 426, 31, 425, 31, 424, 30, 423, 30, 422, 30, 421, 30, 420, 30, 419, 30, 418, 30, 417, 30, 416, 30, 415, 29, 414, 29, 413, 29, 412, 29, 411, 29, 410, 29, 409, 29, 408, 29, 407, 29, 406, 29, 405, 29, 404, 29, 403, 29, 402, 29, 401, 29, 400, 29, 399, 29, 398, 29, 397, 29, 396, 29, 395, 29, 394, 29, 393, 29, 392, 29, 391, 29, 390, 30, 389, 30, 388, 30, 387, 30, 386, 30, 385, 30, 384, 30, 383, 30, 382, 30, 381, 31, 380, 31, 379, 31, 378, 31, 377, 31, 376, 31, 375, 32, 374, 32, 373, 32, 372, 32, 371, 32, 370, 33, 369, 33, 368, 33, 367, 33, 366, 33, 365, 34, 364, 34, 363, 34, 362, 34, 361, 35, 360, 35, 359, 35, 358, 36, 357, 36, 356, 36, 355, 37, 354, 37, 353, 37, 352, 38, 351, 38, 350, 38, 349, 39, 348, 39, 347, 39, 346, 40, 345, 40, 344, 41, 343, 41, 342, 41, 341, 42, 340, 42, 339, 43, 338, 43, 337, 44, 336, 44, 335, 45, 334, 45, 333, 46, 332, 46, 331, 47, 330, 47, 329, 48, 328, 48, 327, 49, 326, 49, 325, 50, 324, 51, 323, 51, 322, 52, 321, 52, 320, 53, 319, 54, 318, 54, 317, 55, 316, 56, 315, 56, 314, 57, 313, 58, 312, 59, 311, 59, 310, 60, 309, 61, 308, 62, 307, 62, 306, 63, 305, 64, 304, 65, 303, 66, 302, 66, 301, 67, 300, 68, 299, 69, 298, 70, 297, 71, 296, 72, 295, 73, 294, 74, 293, 75, 292, 76, 291, 77, 290, 78, 289, 79, 288, 80, 287, 81, 285, 82, 284, 84, 283, 85, 282, 86, 281, 87, 279, 89, 278, 90, 277, 91, 276, 93, 274, 94, 273, 95, 271, 97, 270, 98, 268, 100, 267, 101, 265, 103, 264, 105, 262, 106, 260, 108, 259, 110, 257, 112, 255, 114, 253, 116, 251, 118, 249, 120, 247, 122, 244, 125, 242, 127, 239, 130, 237, 133, 234, 136, 231, 139, 228, 142, 224, 146, 220, 151, 216, 156, 211, 162, 205, 171, 196,
];
private var fish:Array = [
271, 274, 268, 276, 266, 278, 263, 280, 261, 281, 259, 283, 257, 285, 255, 286, 253, 288, 252, 289, 250, 291, 248, 292, 247, 293, 245, 295, 244, 296, 243, 297, 241, 298, 240, 300, 239, 301, 237, 302, 236, 303, 235, 304, 234, 305, 233, 306, 231, 307, 230, 308, 229, 309, 228, 310, 227, 311, 226, 312, 225, 313, 224, 314, 223, 315, 222, 316, 221, 317, 220, 317, 219, 318, 218, 319, 217, 320, 217, 321, 216, 321, 215, 322, 214, 323, 213, 324, 212, 324, 212, 325, 211, 326, 210, 327, 209, 327, 208, 328, 208, 329, 207, 329, 206, 330, 205, 331, 205, 331, 204, 332, 203, 333, 202, 333, 202, 334, 201, 334, 200, 335, 200, 336, 199, 336, 198, 337, 198, 337, 197, 338, 196, 338, 196, 339, 195, 340, 195, 340, 194, 341, 193, 341, 193, 342, 192, 342, 192, 343, 191, 343, 190, 344, 190, 344, 189, 345, 189, 345, 188, 346, 188, 346, 187, 347, 187, 347, 186, 347, 185, 348, 185, 348, 184, 349, 184, 349, 183, 350, 183, 350, 182, 351, 182, 351, 182, 351, 181, 352, 181, 352, 180, 353, 180, 353, 179, 353, 179, 354, 178, 354, 178, 354, 177, 355, 177, 355, 177, 356, 176, 356, 176, 356, 175, 357, 175, 357, 175, 357, 174, 358, 174, 358, 174, 358, 173, 359, 173, 359, 172, 359, 172, 360, 172, 360, 171, 360, 171, 360, 171, 361, 170, 361, 170, 361, 170, 362, 169, 362, 169, 362, 169, 363, 168, 363, 168, 363, 168, 363, 168, 364, 167, 364, 167, 364, 167, 364, 166, 365, 166, 365, 166, 365, 166, 365, 165, 366, 165, 366, 165, 366, 165, 366, 164, 366, 164, 367, 164, 367, 164, 367, 164, 367, 163, 368, 163, 368, 163, 368, 163, 368, 163, 368, 162, 369, 162, 369, 162, 369, 162, 369, 162, 369, 162, 369, 161, 370, 161, 370, 161, 370, 161, 370, 161, 370, 161, 370, 161, 371, 160, 371, 160, 371, 160, 371, 160, 371, 160, 371, 160, 371, 160, 372, 160, 372, 160, 372, 160, 372, 159, 372, 159, 372, 159, 372, 159, 372, 159, 372, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 373, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 159, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 374, 160, 373, 160, 373, 160, 373, 160, 373, 160, 373, 160, 373, 161, 373, 161, 373, 161, 373, 161, 373, 161, 373, 161, 373, 161, 373, 161, 373, 161, 372, 161, 372, 161, 372, 162, 372, 162, 372, 162, 372, 162, 372, 162, 372, 162, 372, 162, 371, 162, 371, 162, 371, 162, 371, 163, 371, 163, 371, 163, 371, 163, 370, 163, 370, 163, 370, 163, 370, 163, 370, 164, 370, 164, 370, 164, 369, 164, 369, 164, 369, 164, 369, 164, 369, 165, 368, 165, 368, 165, 368, 165, 368, 165, 368, 165, 368, 166, 367, 166, 367, 166, 367, 166, 367, 166, 367, 167, 366, 167, 366, 167, 366, 167, 366, 167, 365, 168, 365, 168, 365, 168, 365, 168, 364, 168, 364, 169, 364, 169, 364, 169, 363, 169, 363, 169, 363, 170, 363, 170, 362, 170, 362, 170, 362, 171, 362, 171, 361, 171, 361, 171, 361, 172, 360, 172, 360, 172, 360, 172, 360, 173, 359, 173, 359, 173, 359, 174, 358, 174, 358, 174, 358, 175, 357, 175, 357, 175, 357, 175, 357, 176, 356, 176, 356, 176, 355, 177, 355, 177, 355, 177, 354, 178, 354, 178, 354, 178, 353, 179, 353, 179, 353, 179, 352, 180, 352, 180, 352, 181, 351, 181, 351, 181, 350, 182, 350, 182, 350, 183, 349, 183, 349, 183, 348, 184, 348, 184, 348, 185, 347, 185, 347, 185, 346, 186, 346, 186, 346, 187, 345, 187, 345, 188, 344, 188, 344, 189, 343, 189, 343, 190, 343, 190, 342, 191, 342, 191, 341, 192, 341, 192, 340, 193, 340, 193, 339, 194, 339, 194, 338, 195, 338, 195, 337, 196, 337, 196, 336, 197, 336, 198, 335, 198, 335, 199, 334, 199, 334, 200, 333, 201, 333, 201, 332, 202, 332, 202, 331, 203, 331, 204, 330, 204, 330, 205, 329, 206, 328, 206, 328, 207, 327, 208, 327, 208, 326, 209, 326, 210, 325, 210, 324, 211, 324, 212, 323, 212, 323, 213, 322, 214, 322, 215, 321, 215, 320, 216, 320, 217, 319, 218, 318, 218, 318, 219, 317, 220, 316, 221, 316, 222, 315, 223, 315, 223, 314, 224, 313, 225, 313, 226, 312, 227, 311, 228, 310, 228, 310, 229, 309, 230, 308, 231, 308, 232, 307, 233, 306, 234, 305, 235, 305, 236, 304, 237, 303, 238, 302, 239, 302, 240, 301, 241, 300, 242, 299, 243, 298, 243, 298, 242, 299, 241, 300, 240, 301, 239, 301, 238, 302, 238, 303, 237, 304, 236, 305, 235, 305, 234, 306, 233, 307, 232, 308, 232, 308, 231, 309, 230, 310, 229, 311, 228, 311, 227, 312, 227, 313, 226, 314, 225, 315, 224, 315, 223, 316, 222, 317, 221, 318, 221, 318, 220, 319, 219, 320, 218, 321, 217, 321, 216, 322, 215, 323, 215, 324, 214, 324, 213, 325, 212, 326, 211, 327, 210, 328, 209, 328, 209, 329, 208, 330, 207, 331, 206, 331, 205, 332, 204, 333, 203, 334, 203, 334, 202, 335, 201, 336, 200, 337, 199, 338, 198, 338, 197, 339, 196, 340, 196, 341, 195, 341, 194, 342, 193, 343, 192, 344, 191, 344, 190, 345, 190, 346, 189, 347, 188, 348, 187, 348, 186, 349, 185, 350, 184, 351, 184, 351, 183, 352, 182, 353, 181, 354, 180, 354, 179, 355, 178, 356, 177, 357, 177, 357, 176, 358, 175, 359, 174, 360, 173, 361, 172, 361, 171, 362, 171, 363, 170, 364, 169, 364, 168, 365, 167, 366, 166, 367, 165, 367, 164, 368, 164, 369, 163, 370, 162, 371, 161, 371, 160, 372, 159, 373, 158, 374,
];
private var circle:Array = [
247, 280, 235, 292, 227, 300, 221, 306, 215, 312, 210, 317, 205, 322, 201, 326, 197, 330, 193, 334, 190, 337, 186, 341, 183, 344, 180, 347, 177, 350, 174, 353, 172, 355, 169, 358, 167, 360, 164, 363, 162, 365, 159, 368, 157, 370, 155, 372, 153, 374, 151, 376, 148, 379, 146, 381, 144, 383, 143, 384, 141, 386, 139, 388, 137, 390, 135, 392, 133, 394, 132, 395, 130, 397, 128, 399, 127, 400, 125, 402, 123, 404, 122, 405, 120, 407, 119, 408, 117, 410, 116, 411, 114, 413, 113, 414, 111, 416, 110, 417, 109, 418, 107, 420, 106, 421, 105, 422, 103, 424, 102, 425, 101, 426, 100, 427, 98, 429, 97, 430, 96, 431, 95, 432, 93, 434, 92, 435, 91, 436, 90, 437, 89, 438, 88, 439, 87, 440, 86, 441, 85, 442, 83, 444, 82, 445, 81, 446, 80, 447, 79, 448, 78, 449, 77, 450, 76, 451, 75, 452, 74, 453, 73, 454, 72, 455, 72, 455, 71, 456, 70, 457, 69, 458, 68, 459, 67, 460, 66, 461, 65, 462, 64, 463, 63, 464, 63, 464, 62, 465, 61, 466, 60, 467, 59, 468, 59, 468, 58, 469, 57, 470, 56, 471, 55, 472, 55, 472, 54, 473, 53, 474, 52, 475, 52, 475, 51, 476, 50, 477, 49, 478, 49, 478, 48, 479, 47, 480, 47, 480, 46, 481, 45, 482, 45, 482, 44, 483, 43, 484, 43, 484, 42, 485, 41, 486, 41, 486, 40, 487, 40, 487, 39, 488, 38, 489, 38, 489, 37, 490, 37, 490, 36, 491, 35, 492, 35, 492, 34, 493, 34, 493, 33, 494, 33, 494, 32, 495, 32, 495, 31, 496, 31, 496, 30, 497, 29, 498, 29, 498, 28, 499, 28, 499, 27, 500, 27, 500, 27, 500, 26, 501, 26, 501, 25, 502, 25, 502, 24, 503, 24, 503, 23, 504, 23, 504, 22, 505, 22, 505, 22, 505, 21, 506, 21, 506, 20, 507, 20, 507, 20, 507, 19, 508, 19, 508, 18, 509, 18, 509, 18, 509, 17, 510, 17, 510, 16, 511, 16, 511, 16, 511, 15, 512, 15, 512, 15, 512, 14, 513, 14, 513, 14, 513, 13, 514, 13, 514, 13, 514, 12, 515, 12, 515, 12, 515, 12, 515, 11, 516, 11, 516, 11, 516, 10, 517, 10, 517, 10, 517, 10, 517, 9, 518, 9, 518, 9, 518, 9, 518, 8, 519, 8, 519, 8, 519, 8, 519, 7, 520, 7, 520, 7, 520, 7, 520, 7, 520, 6, 521, 6, 521, 6, 521, 6, 521, 6, 521, 5, 522, 5, 522, 5, 522, 5, 522, 5, 522, 5, 522, 4, 523, 4, 523, 4, 523, 4, 523, 4, 523, 4, 523, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 1, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 2, 525, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 3, 524, 4, 523, 4, 523, 4, 523, 4, 523, 4, 523, 4, 523, 5, 522, 5, 522, 5, 522, 5, 522, 5, 522, 5, 522, 6, 521, 6, 521, 6, 521, 6, 521, 6, 521, 7, 520, 7, 520, 7, 520, 7, 520, 7, 520, 8, 519, 8, 519, 8, 519, 8, 519, 9, 518, 9, 518, 9, 518, 9, 518, 10, 517, 10, 517, 10, 517, 10, 517, 11, 516, 11, 516, 11, 516, 12, 515, 12, 515, 12, 515, 12, 515, 13, 514, 13, 514, 13, 514, 14, 513, 14, 513, 14, 513, 15, 512, 15, 512, 15, 512, 16, 511, 16, 511, 16, 511, 17, 510, 17, 510, 18, 509, 18, 509, 18, 509, 19, 508, 19, 508, 20, 507, 20, 507, 20, 507, 21, 506, 21, 506, 22, 505, 22, 505, 22, 505, 23, 504, 23, 504, 24, 503, 24, 503, 25, 502, 25, 502, 26, 501, 26, 501, 27, 500, 27, 500, 27, 500, 28, 499, 28, 499, 29, 498, 29, 498, 30, 497, 31, 496, 31, 496, 32, 495, 32, 495, 33, 494, 33, 494, 34, 493, 34, 493, 35, 492, 35, 492, 36, 491, 37, 490, 37, 490, 38, 489, 38, 489, 39, 488, 40, 487, 40, 487, 41, 486, 41, 486, 42, 485, 43, 484, 43, 484, 44, 483, 45, 482, 45, 482, 46, 481, 47, 480, 47, 480, 48, 479, 49, 478, 49, 478, 50, 477, 51, 476, 52, 475, 52, 475, 53, 474, 54, 473, 55, 472, 55, 472, 56, 471, 57, 470, 58, 469, 59, 468, 59, 468, 60, 467, 61, 466, 62, 465, 63, 464, 63, 464, 64, 463, 65, 462, 66, 461, 67, 460, 68, 459, 69, 458, 70, 457, 71, 456, 72, 455, 72, 455, 73, 454, 74, 453, 75, 452, 76, 451, 77, 450, 78, 449, 79, 448, 80, 447, 81, 446, 82, 445, 83, 444, 85, 442, 86, 441, 87, 440, 88, 439, 89, 438, 90, 437, 91, 436, 92, 435, 93, 434, 95, 432, 96, 431, 97, 430, 98, 429, 100, 427, 101, 426, 102, 425, 103, 424, 105, 422, 106, 421, 107, 420, 109, 418, 110, 417, 111, 416, 113, 414, 114, 413, 116, 411, 117, 410, 119, 408, 120, 407, 122, 405, 123, 404, 125, 402, 127, 400, 128, 399, 130, 397, 132, 395, 133, 394, 135, 392, 137, 390, 139, 388, 141, 386, 143, 384, 144, 383, 146, 381, 148, 379, 151, 376, 153, 374, 155, 372, 157, 370, 159, 368, 162, 365, 164, 363, 167, 360, 169, 358, 172, 355, 174, 353, 177, 350, 180, 347, 183, 344, 186, 341, 190, 337, 193, 334, 197, 330, 201, 326, 205, 322, 210, 317, 215, 312, 221, 306, 227, 300, 235, 292, 247, 280,
];
//-------------------------------//
// Change functions as follows.
//-------------------------------//
public function updateEnterFrame( e:Event ):void{
removeEventListener(e.type, arguments.callee);
transform.matrix
initialize();
}
private function updateEnterFrame2(e:Event = null):void {
//_sliceHolder.rotationY += 1;
}
private function hideAllSlices():void {
var bmp:Bitmap;
var i:int;
var len:int = _sliceList.length;
for (i = 0; i < len; i++) {
bmp = _sliceList[i] as Bitmap;
bmp.visible = false;
}
}
private function initialize():void {
addEventListener(Event.ENTER_FRAME, updateEnterFrame2);
var pv:PerspectiveProjection = new PerspectiveProjection();
pv.projectionCenter.x = stage.stageWidth * 0.5;
pv.projectionCenter.y = stage.stageHeight * 0.5;
pv.focalLength = 500 * 2;
transform.perspectiveProjection = pv;
var len:int;
var bmp:Bitmap;
var i:int;
addChild(_sliceHolder = new Sprite());
_sliceHolder.x = stage.stageWidth * 0.5;
_sliceHolder.y = stage.stageHeight * 0.5;
_sliceHolder.z = stage.stageWidth * 0.5;
len = _sliceList.length;
for (i = 0; i < len; i++) {
bmp = _sliceList[i] as Bitmap;
_sliceHolder.addChild(bmp);
bmp.x = -(len * 0.5) + i;
bmp.y = - bmp.height * 0.5;
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
}
private function mouseDownHandler(event:MouseEvent):void
{
var num:int = int(Math.random() * 3 + 1);
_flag ? this["pump"+num]() : shrivel();
_flag = !_flag;
}
private function pump2():void {
var i:int;
var len:int = _sliceList.length;
var s:int;
var e:int;
var bmp:Bitmap;
var tl:TweensyTimeline;
for (i = 0; i < len; i++) {
s = hart[2*i];
e = hart[2*i + 1];
bmp = _sliceList[i] as Bitmap;
Tweensy.to(bmp, { y:s - 250, height:e-s }, 1 + 0.002*i, Elastic.easeOut, 0.0001*i );
}
}
private function pump3():void {
var i:int;
var len:int = _sliceList.length;
var s:int;
var e:int;
var bmp:Bitmap;
var tl:TweensyTimeline;
for (i = 0; i < len; i++) {
s = fish[2*i];
e = fish[2*i + 1];
bmp = _sliceList[i] as Bitmap;
Tweensy.to(bmp, { y:s - 250, height:e-s }, 1 + 0.002*i, Elastic.easeOut, 0.0001*i );
}
}
private function pump1():void {
var i:int;
var len:int = _sliceList.length;
var s:int;
var e:int;
var bmp:Bitmap;
var tl:TweensyTimeline;
for (i = 0; i < len; i++) {
s = circle[2*i];
e = circle[2*i + 1];
bmp = _sliceList[i] as Bitmap;
Tweensy.to(bmp, { y:s - 250, height:e-s }, 1 + 0.002*i, Elastic.easeOut, 0.0001*i );
}
}
private function shrivel():void {
var i:int;
var len:int = _sliceList.length;
var s:int;
var e:int;
var bmp:Bitmap;
var tl:TweensyTimeline;
for (i = 0; i < len; i++) {
bmp = _sliceList[i] as Bitmap;
Tweensy.to(bmp, {y:-35, height:70}, 2 + 0.002*i, Bounce.easeOut, 0.001*i);
}
}
//-------------------------------//
// Do not change following codes.
//-------------------------------//
public function Massmedian(){
var ctxt :LoaderContext = new LoaderContext(true);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoadComplete );
loader.load( new URLRequest("http://swf.wonderfl.net/static/assets/massmedian.png"), ctxt );
}
public function onLoadComplete(e:Event):void {
var loader:Loader = LoaderInfo( e.target ).loader;
loader.contentLoaderInfo.removeEventListener( Event.COMPLETE, onLoadComplete );
var bitmapdata:BitmapData = new BitmapData( loader.width, loader.height, true, 0xFF0000 );
bitmapdata.draw( loader );
_sliceList = sliceBanner( bitmapdata, bitmapdata.width );
addEventListener( Event.ENTER_FRAME, updateEnterFrame );
}
private function sliceBanner( banner:BitmapData, length:int = 100 ):Array{
var sliceList:Array = [];
var w:int = Math.floor( banner.width/length );
var h:int = Math.floor( banner.height );
var t:int = Math.ceil( banner.width - w*length );
var mat:Matrix = new Matrix();
for( var i:int = 0; i<length; i++ ) {
var bmpd :BitmapData = new BitmapData( w, h, true, 0xFFFF00 );
mat.tx = -w*i;
bmpd.draw( banner, mat );
var part:DisplayObject = addChild( new Bitmap( bmpd ) );
part.x = w*i;
sliceList.push( part );
}
return sliceList;
}
}
}