Skip to content

Commit

Permalink
more commit oriented
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-i committed Dec 22, 2022
1 parent caf7d16 commit 5a7d95f
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 37 deletions.
207 changes: 175 additions & 32 deletions demo/demo.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,182 @@
<?xml version="1.0"?><SWF><Header><width>800</width><height>600</height><backgroundcolor>15790335</backgroundcolor><fps>12</fps></Header>
<Elements><Font><fontname>_sans</fontname><font_flags>0</font_flags><NamedId>font</NamedId></Font>
<DBL><imagepath>dbl1.dbl</imagepath><NamedId>image_rgb</NamedId></DBL>
<DBL><imagepath>dbl2.dbl</imagepath><NamedId>image_rgba</NamedId></DBL>
<Text><width>800</width><height>100</height><variablename></variablename><flags>129</flags><EditText><font_id>font</font_id><font_height>20</font_height><fontclassname></fontclassname><rgba>0</rgba><maxlength>0</maxlength><initialtext>Demo</initialtext><layout_align>0</layout_align><layout_leftmargin>0</layout_leftmargin><layout_rightmargin>0</layout_rightmargin><layout_indent>0</layout_indent><layout_leading>0</layout_leading></EditText>
<NamedId>text</NamedId></Text>
<Shape><width>164</width><height>164</height><Array><I0>64</I0><I1>image_rgb</I1><I2>0</I2><I3>0</I3><I4>2</I4><I5>1</I5><I6>1</I6><I7>164</I7><I8>0</I8><I9>1</I9><I10>1</I10><I11>0</I11><I12>164</I12><I13>1</I13><I14>1</I14><I15>-164</I15><I16>0</I16><I17>1</I17><I18>1</I18><I19>0</I19><I20>-164</I20><I21>-1</I21></Array>
<NamedId>shape</NamedId></Shape>
<Button><width>200</width><height>100</height><ButtonData><def_fill>-16776961</def_fill><def_line_sz>10</def_line_sz><def_line>255</def_line><ov_fill>16711935</ov_fill><ov_line_sz>10</ov_line_sz><ov_line>65535</ov_line><dn_fill>8947848</dn_fill><dn_line_sz>10</dn_line_sz><dn_line>34952</dn_line><xcurve>30</xcurve><ycurve>20</ycurve><text>Button</text><font_id>font</font_id><font_height>20</font_height><font_vertical_offset>0</font_vertical_offset><font_color>255</font_color><actions>gotoAndPlay(0)</actions></ButtonData>
<NamedId>button</NamedId></Button>
<Shape><width>164</width><height>164</height><Array><I0>64</I0><I1>image_rgba</I1><I2>0</I2><I3>0</I3><I4>2</I4><I5>1</I5><I6>1</I6><I7>164</I7><I8>0</I8><I9>1</I9><I10>1</I10><I11>0</I11><I12>164</I12><I13>1</I13><I14>1</I14><I15>-164</I15><I16>0</I16><I17>1</I17><I18>1</I18><I19>0</I19><I20>-164</I20><I21>-1</I21></Array>
<NamedId>shape transp</NamedId></Shape>
<SpriteNew><NamedId>0</NamedId></SpriteNew>
<SpritePlacementCoords exclude="false"><spriteid>0</spriteid><refid>button</refid><depth>0</depth><x>0</x><y>0</y></SpritePlacementCoords>
<SpritePlacementCoords exclude="false"><spriteid>0</spriteid><refid>shape</refid><depth>1</depth><x>175</x><y>0</y></SpritePlacementCoords>
<SpriteAction><spriteid>0</spriteid><ac>trace("mc 0");
stop()</ac></SpriteAction>
<SpriteShowFrame><spriteid>0</spriteid></SpriteShowFrame>
<SpriteRemove><spriteid>0</spriteid><depth>1</depth></SpriteRemove>
<SpriteAction><spriteid>0</spriteid><ac>trace("mc 1");
stop()</ac></SpriteAction>
<SpriteShowFrame><spriteid>0</spriteid></SpriteShowFrame>
<SpriteDone><spriteid>0</spriteid><NamedId>movieclip</NamedId></SpriteDone>
<ExportsAdd><refid>movieclip</refid><name>movieTest</name></ExportsAdd>
<?xml version="1.0"?><SWF><Header><width>800</width>
<height>600</height>
<backgroundcolor>15790335</backgroundcolor>
<fps>12</fps>
</Header>
<Elements><Font><fontname>_sans</fontname>
<font_flags>0</font_flags>
<NamedId>font</NamedId>
</Font>
<DBL><imagepath>dbl1.dbl</imagepath>
<NamedId>image_rgb</NamedId>
</DBL>
<DBL><imagepath>dbl2.dbl</imagepath>
<NamedId>image_rgba</NamedId>
</DBL>
<Text><width>800</width>
<height>100</height>
<variablename></variablename>
<flags>129</flags>
<EditText><font_id>font</font_id>
<font_height>20</font_height>
<fontclassname></fontclassname>
<rgba>0</rgba>
<maxlength>0</maxlength>
<initialtext>Demo</initialtext>
<layout_align>0</layout_align>
<layout_leftmargin>0</layout_leftmargin>
<layout_rightmargin>0</layout_rightmargin>
<layout_indent>0</layout_indent>
<layout_leading>0</layout_leading>
</EditText>
<NamedId>text</NamedId>
</Text>
<Shape><width>164</width>
<height>164</height>
<Array><I0>64</I0>
<I1>image_rgb</I1>
<I2>0</I2>
<I3>0</I3>
<I4>2</I4>
<I5>1</I5>
<I6>1</I6>
<I7>164</I7>
<I8>0</I8>
<I9>1</I9>
<I10>1</I10>
<I11>0</I11>
<I12>164</I12>
<I13>1</I13>
<I14>1</I14>
<I15>-164</I15>
<I16>0</I16>
<I17>1</I17>
<I18>1</I18>
<I19>0</I19>
<I20>-164</I20>
<I21>-1</I21>
</Array>
<NamedId>shape</NamedId>
</Shape>
<Button><width>200</width>
<height>100</height>
<ButtonData><def_fill>-16776961</def_fill>
<def_line_sz>10</def_line_sz>
<def_line>255</def_line>
<ov_fill>16711935</ov_fill>
<ov_line_sz>10</ov_line_sz>
<ov_line>65535</ov_line>
<dn_fill>8947848</dn_fill>
<dn_line_sz>10</dn_line_sz>
<dn_line>34952</dn_line>
<xcurve>30</xcurve>
<ycurve>20</ycurve>
<text>Button</text>
<font_id>font</font_id>
<font_height>20</font_height>
<font_vertical_offset>0</font_vertical_offset>
<font_color>255</font_color>
<actions>gotoAndPlay(0)</actions>
</ButtonData>
<NamedId>button</NamedId>
</Button>
<Shape><width>164</width>
<height>164</height>
<Array><I0>64</I0>
<I1>image_rgba</I1>
<I2>0</I2>
<I3>0</I3>
<I4>2</I4>
<I5>1</I5>
<I6>1</I6>
<I7>164</I7>
<I8>0</I8>
<I9>1</I9>
<I10>1</I10>
<I11>0</I11>
<I12>164</I12>
<I13>1</I13>
<I14>1</I14>
<I15>-164</I15>
<I16>0</I16>
<I17>1</I17>
<I18>1</I18>
<I19>0</I19>
<I20>-164</I20>
<I21>-1</I21>
</Array>
<NamedId>shape transp</NamedId>
</Shape>
<SpriteNew><NamedId>0</NamedId>
</SpriteNew>
<SpritePlacementCoords exclude="false"><spriteid>0</spriteid>
<refid>button</refid>
<depth>0</depth>
<x>0</x>
<y>0</y>
</SpritePlacementCoords>
<SpritePlacementCoords exclude="false"><spriteid>0</spriteid>
<refid>shape</refid>
<depth>1</depth>
<x>175</x>
<y>0</y>
</SpritePlacementCoords>
<SpriteAction><spriteid>0</spriteid>
<ac>trace("mc 0");
stop()</ac>
</SpriteAction>
<SpriteShowFrame><spriteid>0</spriteid>
</SpriteShowFrame>
<SpriteRemove><spriteid>0</spriteid>
<depth>1</depth>
</SpriteRemove>
<SpriteAction><spriteid>0</spriteid>
<ac>trace("mc 1");
stop()</ac>
</SpriteAction>
<SpriteShowFrame><spriteid>0</spriteid>
</SpriteShowFrame>
<SpriteDone><spriteid>0</spriteid>
<NamedId>movieclip</NamedId>
</SpriteDone>
<ExportsAdd><refid>movieclip</refid>
<name>movieTest</name>
</ExportsAdd>
<ExportsDone></ExportsDone>
<PlacementCoords exclude="false"><refid>text</refid><depth>0</depth><x>0</x><y>0</y></PlacementCoords>
<PlacementCoords exclude="false"><refid>shape transp</refid><depth>1</depth><x>250</x><y>50</y></PlacementCoords>
<PlacementCoords exclude="false"><refid>button</refid><depth>2</depth><x>25</x><y>200</y></PlacementCoords>
<PlacementCoords exclude="false"><refid>movieclip</refid><depth>3</depth><x>50</x><y>400</y></PlacementCoords>
<Action><ac>trace("frame 0")</ac></Action>
<PlacementCoords exclude="false"><refid>text</refid>
<depth>0</depth>
<x>0</x>
<y>0</y>
</PlacementCoords>
<PlacementCoords exclude="false"><refid>shape transp</refid>
<depth>1</depth>
<x>250</x>
<y>50</y>
</PlacementCoords>
<PlacementCoords exclude="false"><refid>button</refid>
<depth>2</depth>
<x>25</x>
<y>200</y>
</PlacementCoords>
<PlacementCoords exclude="false"><refid>movieclip</refid>
<depth>3</depth>
<x>50</x>
<y>400</y>
</PlacementCoords>
<Action><ac>trace("frame 0")</ac>
</Action>
<ShowFrame></ShowFrame>
<PlacementCoords exclude="false"><refid>movieclip</refid><depth>4</depth><x>100</x><y>0</y></PlacementCoords>
<Remove><depth>1</depth></Remove>
<PlacementCoords exclude="false"><refid>movieclip</refid>
<depth>4</depth>
<x>100</x>
<y>0</y>
</PlacementCoords>
<Remove><depth>1</depth>
</Remove>
<Action><ac>trace("frame 1");
attachMovie('movieTest','test',100);test._x=300;test._y=200;
stop()</ac></Action>
stop()</ac>
</Action>
<ShowFrame></ShowFrame>
</Elements>
</SWF>
1 change: 1 addition & 0 deletions jwine
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ wine "/home/bc/.wine/drive_c/Program Files/Java/jdk1.8.0_202/bin/javac.exe" -d "

#java
#wine "/home/bc/.wine/drive_c/Program Files/Java/jdk1.8.0_202/bin/java.exe" -jar flashalizer.jar /home/bc/f/flashalizer/demo
#wine "/home/bc/.wine/drive_c/Program Files/Java/jdk1.8.0_202/bin/java.exe" -classpath "/home/bc/f/b/flashalizer;/home/bc/f/b/javassist.jar;/home/bc/f/b/jna-4.5.0.jar;/home/bc/f/b/jna-platform-4.5.0.jar" flashalizer /home/bc/f/flashalizer/demo

#jdb
#jdb.ini in users/bc
Expand Down
6 changes: 3 additions & 3 deletions src/workspace/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void read() throws Throwable{
backgroundcolor=Long.decode(rd.data()).intValue();
fps=Long.decode(rd.data()).intValue();
rd.advance();
rd.advance();//our new line
rd.advance();//our new line 1
rd.advance();//Elements
String tag;
while((tag=rd.advance_start())!=null)elements.add(read_base(rd,tag,Elements.class.getDeclaredClasses()));
Expand Down Expand Up @@ -225,15 +225,15 @@ private Object read_base(StaXParser rd,String className,Class<?>[]cs) throws XML
if(isShapeBitmap((int)dest[0])){i=2;dest[1]=ints.get(1);}
for(;i<dest.length;i++)dest[i]=Long.decode((String)ints.get(i)).intValue();
values.add(dest);
rd.advance();//our new line
rd.advance();//our new line 1
}
else/*EditText,button*/values.add(read_base(rd,tp,c.getDeclaredClasses()));
}
}

//last reader advance
rd.advance();
rd.advance();//our new line
rd.advance();//our new line 1
Object ob=runtime_instance(c,values);
if(exclstr!=null)((elementplus)ob).exclude=Boolean.parseBoolean(exclstr);
return ob;
Expand Down
2 changes: 2 additions & 0 deletions src/xml/StaXParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ public String data() throws XMLStreamException{
if(start.isStartElement()==false)return null;
XMLEvent e=eventReader.nextEvent();
if(e.isEndElement()==true){
advance();//our new line 2, needed also at demo
return "";
}
String s="";
do{
s+=e.asCharacters().getData();//this is required there are cases when (text multiple lines breaks text again lines) is chopped
e=eventReader.nextEvent();
}while(e.isEndElement()==false);
advance();//our new line 2, needed also at demo
return s;
}
public void close() throws IOException, XMLStreamException{
Expand Down
8 changes: 6 additions & 2 deletions src/xml/StaXWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void start_attr(String s,String a,String b) throws XMLStreamException{
StartElement StartElement = eventFactory.createStartElement("","",s,Arrays.asList(attr).iterator(),Arrays.asList().iterator());
eventWriter.add(StartElement);
}
public void data(String s,String value) throws XMLStreamException{
public void data(String s,String value) throws XMLStreamException,IOException{
StartElement StartElement = eventFactory.createStartElement("","",s);
eventWriter.add(StartElement);
// create Content
Expand All @@ -48,13 +48,17 @@ public void data(String s,String value) throws XMLStreamException{
// create End node
EndElement eElement = eventFactory.createEndElement("", "", s);
eventWriter.add(eElement);

eventWriter.flush();//important
out.write('\n');//new line 2
}
public void end(String s) throws XMLStreamException,IOException{
EndElement eElement = eventFactory.createEndElement("", "", s);
eventWriter.add(eElement);

eventWriter.flush();//important
// out.flush();
out.write('\n');
out.write('\n');//new line 1
}
public void close() throws XMLStreamException, IOException{
eventWriter.add(eventFactory.createEndDocument());
Expand Down

0 comments on commit 5a7d95f

Please sign in to comment.