From fe599bf2f0a8a463635fb85a4f823c8c57a4520a Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Tue, 10 Jan 2012 10:25:55 -0500 Subject: [PATCH] Added ActionScript --- lightningbeam | 13 ++++--------- svlgui.py | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lightningbeam b/lightningbeam index 3a88bc1..2e6813f 100755 --- a/lightningbeam +++ b/lightningbeam @@ -34,19 +34,16 @@ def onLoadFrames(self): j = box(i*16,0,16,32,svlgui.Color([1,1,1])) self.add(j)''' def onClickFrame(self, x, y): - print x, int(x/16) root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text root.descendItem().activeframe = int(x/16) MainWindow.stage.draw() - MainWindow.scriptwindow.text = root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions + MainWindow.scriptwindow.text = str(root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions) def onKeyDownFrame(self, key): + root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text if key=="F6": add_keyframe() + MainWindow.scriptwindow.text = root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions def onMouseDownGroup(self, x, y): - print ">>>", MainWindow.scriptwindow.text - print dir(MainWindow.scriptwindow._int()) - #MainWindow.scriptwindow._int().become_target() - print MainWindow.scriptwindow._int().is_target() self.activelayer.frames[self.activelayer.currentframe].actions = MainWindow.scriptwindow.text if svlgui.MODE in [" ", "s"]: if self.hitTest(x, y): @@ -130,6 +127,7 @@ def create_sc(root): def run_file(self=None): global root print "RUNNING" + root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text open("test.sc", "w").write(create_sc(root)) svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" test.sc -o test.swf") @@ -232,11 +230,8 @@ def quit(widget): def add_keyframe(widget=None): root.descendItem().add_frame(True) - print root.descendItem().activeframe - print root.descendItem().activeframe*16 b = svlgui.Image("media/keyframe_active.png",root.descendItem().activeframe*16,0,True,MainWindow.timelinebox,16,1) frames.add(b) - print [i.x for i in frames.activelayer.frames[0].objs] MainWindow.timelinebox.draw() def add_layer(widget=None): root.descendItem().add_layer(root.descendItem()._al) diff --git a/svlgui.py b/svlgui.py index 58e8c27..ee0ce7f 100644 --- a/svlgui.py +++ b/svlgui.py @@ -1194,6 +1194,8 @@ class frame: retval = retval+".put "+i.name+" x="+str(i.x)+" y="+str(i.y)+"\n" else: retval = retval+".move "+i.name+" x="+str(i.x)+" y="+str(i.y)+"\n" + if not self.actions.strip()=='': + retval = retval + ".action:\n"+self.actions+"\n.end\n" return retval