on renamebuttons repeat with j=1 to the number of castlibs repeat with i=1 to the number of members of castlib j mem=member(i,j) nm=mem.name repeat with k=1 to nm.length if nm.char[k]="_" then put " " into nm.char[k] end repeat mem.name=nm end repeat end repeat end on renamebuttonsbylib lib if voidp(lib) then lib = the activecastlib s=castlib(lib).selection repeat with lyst in s repeat with i=lyst[1] to lyst[2] mem=member(i,lib) nm=mem.name off=offset("_",nm) if off<>0 then put " " into nm.char[off] mem.name=nm end repeat end repeat end on transformbitmaps lib if voidp(lib) then lib= the activecastlib s=castlib(lib).selection repeat with lyst in s repeat with i=lyst[1] to lyst[2] mem=member(i,lib) if mem.type<>#bitmap then next repeat im=mem.image if im.depth=32 then im2=image(im.width,im.height,16) im2.copypixels(im,im.rect,im.rect) reg=mem.regpoint mem.image=im2 mem.regpoint=reg end if end repeat end repeat end on converttofield lib, retain, sameplace if voidp(lib) then lib= the activecastlib if voidp(retain) then retain=1 if voidp(sameplace) then sameplace=1 s=castlib(lib).selection repeat with lyst in s repeat with i=lyst[1] to lyst[2] mem=member(i,lib) if mem.type<>#text then next repeat if sameplace then newmem=new(#text) newmem.media=mem.media newmem.name=mem.name erase mem mem=newmem f=new(#field,member(i,lib)) else f=new(#field) end if f.text=mem.text f.rect=mem.rect f.alignment=string(mem.alignment) f.name=mem.name repeat with k=1 to mem.text.length the font of char k of field f = mem.char[k].font the fontsize of char k of field f = mem.char[k].fontsize s=mem.char[k].fontstyle tx="" repeat with sym in s tx=tx&sym&"," end repeat if tx.length>0 then delete tx.char[tx.length] the fontstyle of char k of field f = tx end if end repeat if not retain then erase mem end repeat end repeat end on drawsquare w, nm, col, bg, s v=new(#vectorshape) v.vertexlist=[[#vertex:point(0,0)],[#vertex:point(0,w)],[#vertex:point(w,w)],[#vertex:point(w,0)]] if voidp(bg) then bg=rgb(255,255,255) if voidp(col) then col=rgb(0,0,0) if voidp(s) then s=1 v.backgroundcolor=bg v.strokecolor=col v.strokewidth=s v.closed=1 v.fillmode=#none mem=new(#bitmap) mem.image=v.image mem.name=string(nm) erase v end on drawmaze m, w if voidp(w) then w=20 vert=m.count hor=m[1].count maze=image(w*hor+1,w*vert+1,16) repeat with i=1 to vert repeat with j=1 to hor sq=m[i][j] if sq mod 2 or i=vert then maze.draw((j-1)*w,i*w,j*w,i*w+1,rgb(0,0,0)) if sq>1 or j=hor then maze.draw(j*w,(i-1)*w,j*w+1,i*w,rgb(0,0,0)) end repeat end repeat maze.draw(0,0,1,w*vert,rgb(0,0,0)) maze.draw(0,0,w*hor,1,rgb(0,0,0)) mem=new(#bitmap) mem.image=maze end on createflashframes mem if stringp(mem) or integerp(mem) then mem=member(mem) f=mem.framecount l=string(f).length-1 start=(the number of members of castlib 1) repeat with i=1 to f mem.posterframe=i m=new(#bitmap,member(start+i,1)) m.image=mem.image n=string(i) repeat with j=n.length to l put "0" before n end repeat m.name=mem.name&"."&n end repeat end on convertflash beginrecording lst=the lastframe repeat with i=1 to lst go to frame i repeat with j=1 to the lastchannel if sprite(j).type<>0 then mem=sprite(j).member if mem.type=#flash then f=mem.framecount if member(mem.name&"."&f).number=-1 then createflashframes2(mem) end if the framescript=void lst=lst+f-1 i=i+f-1 sprite(j).member=member(mem.name&".1") repeat with k=2 to f insertframe sprite(j).member=member(mem.name&"."&k) end repeat exit repeat end if end if end repeat end repeat endrecording end on createflashframes2 mem if stringp(mem) or integerp(mem) then mem=member(mem) f=mem.framecount start=(the number of members of castlib 1) repeat with i=1 to f mem.posterframe=i m=new(#bitmap,member(start+i,1)) m.image=mem.image m.name=mem.name&"."&i end repeat end on convertflash2 l=[] beginrecording lst=the lastframe repeat with i=1 to lst go to frame i repeat with j=1 to the lastchannel if sprite(j).type<>0 then mem=sprite(j).member if mem.type=#flash then f=mem.framecount if member(mem.name&"."&f).number=-1 then createflashframes2(mem) end if m=new(#filmloop) m.name=mem.name&&"loop" l.add([mem,m,sprite(j).loc]) sprite(j).member=m end if end if end repeat end repeat endrecording sc=new(#filmloop) sc.media=the score repeat with loops in l the score=loops[2].media beginrecording repeat with k=1 to f go to frame k sprite(1).member=member(loops[1].name&"."&k) sprite(1).loc=loops[3] end repeat updateframe endrecording loops[2].media=the score end repeat the score=sc.media erase sc end