前言:
本项目主要是通过把地图切片嵌入swf,把切片坐标用Java数据打包,然后 在Flex项目内通过Java读取打包数据,通讯给Flex,最后把swf内的图片安放在对应位置来实大地图 拆分->打包->再现的过程。
1. swf图片打包代码 BitMapClass.as
package
{
import flash.display.Sprite;
public class BitMapClass extends Sprite
{
[Embed(source="map1/face.png")]
[Bindable]
public var face:Class;
[Embed(source="map7/0.swf")]
[Bindable]
public var c0:Class;
[Embed(source="map7/1.swf")]
[Bindable]
public var c1:Class;
[Embed(source="map7/2.swf")]
[Bindable]
public var c2:Class;
……
[Embed(source="/map8/18.png")]
[Bindable]
public var z18:Class;
public var arr1:Array = [face];
public var arr2:Array = [s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10];
public var arr3:Array = [b0,b1,b2,b3];
public var arr5:Array = [[b00,b01,b02,b03,b04],[b10,b11,b12,b13,b14],[b20,b21,b22,b23,b24]];
public var arr6:Array = [w0,w1,w2,w3];
public var arr7:Array = [c0,c1,c2,c3];
public var arr8:Array = [z0, z2, z3, z4, z5, z6, z7, z8, z9, z10, z11, z12, z13, z14, z15, z16, z17, z18];
public var arr9:Array = [l0,l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,l16,l17];
public var arr10:Array = [sk0,sk1,sk2,sk3,sk4,sk5];
public var arr11:Array = [o0,o1,o2,o3,o4,o5];
public var arr12:Array = [h0,h1,h2,h3,h4,h5];
public function BitMapClass()
{
super();
}
public function getmap1():Array{
return arr1;
}
public function getmap2():Array{
return arr2;
}
public function getmap3():Array{
return arr3;
}
public function getmap5():Array{
return arr5;
}
public function getmap6():Array{
return arr6;
}
public function getmap7():Array{
return arr7;
}
public function getmap8():Array{
return arr8;
}
public function getmap9():Array{
return arr9;
}
public f