X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=b540cf1b9b51ed5921063ab2947d37179ea160e8;hb=0ca3fee4832ff2576e45a9cb1fbd6f47c74c3e56;hp=c03a997d6ee1f78e9ccc98ba59f4f20e486ebd2e;hpb=6778a872476db77a83e2885a22891fd3d32f1348;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index c03a997..b540cf1 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -1334,9 +1334,23 @@ int swf_WriteSWF2(writer_t*writer, SWF * swf) // Writes SWF to file, return } if(swf->fileVersion >= 9) { + TAG*tag = swf->firstTag; + U32 flags = 0x08; // | 128 = usenetwork, | 16 = hasmetadata | 8 = actionscript3 + int has_version_8_action=0; + int has_version_9_action=0; + while(tag) { + /* FIXME: this doesn't find actionscript in buttons */ + if(tag->id == ST_DOACTION || tag->id == ST_DOINITACTION) + has_version_8_action=1; + if(tag->id == ST_DOABC) + has_version_9_action=1; + tag = tag->next; + } + if(has_version_8_action && !has_version_9_action) + flags = 0x00; + if (swf->firstTag && swf->firstTag->id != ST_FILEATTRIBUTES) { - U32 flags = 0x8; // | 128 = usenetwork, | 16 = Actionscript3 | 8 = hasmetadata swf_SetU32(swf_InsertTagBefore(swf, swf->firstTag,ST_FILEATTRIBUTES),flags); } }