return 1; // NG
}
for (tag=swf->tag_head ; tag ; tag=tag->next) {
- if (isActionTag(tag->code)) {
+ if (isActionTag(tag->code) || isButtonTag(tag->code)) {
ret = swf_tag_replace_action_strings(tag, kv, &m, swf);
if (ret) {
fprintf(stderr, "swf_object_replace_action_strings: swf_tag_replace_action_string failed\n");
int modified = 0;
swf_tag_t *t;
for (t = tag_sprite->tag ; t ; t = t->next) {
- if (isActionTag(t->code)) {
+ if (isActionTag(t->code) || isButtonTag(tag->code)) {
ret = swf_tag_replace_action_strings(t, kv, &m, swf);
if (ret) {
fprintf(stderr, "swf_object_replace_action_strings: replace_action_string failed\n");
t->data = NULL;
}
modified = 1; // action tag modified
- }
+ }
}
if (modified) { // sprite tag rebuild
if (tag->data) {
int
swf_tag_replace_action_strings(swf_tag_t *tag, y_keyvalue_t *kv,
int *modified, struct swf_object_ *swf) {
- int ret;
+ int ret = 1;
if (tag == NULL) {
fprintf(stderr, "swf_tag_replace_action_string: tag == NULL\n");
return 1; // NG
fprintf(stderr, "swf_tag_replace_action_string: swf_tag_create_input_detail failed\n");
return 1; // NG
}
- ret = swf_tag_action_replace_strings(tag, kv, modified);
- if (ret) {
- fprintf(stderr, "swf_tag_replace_action_string: swf_tag_action_replace_strings failed\n");
+ if (isActionTag(tag->code)) {
+ ret = swf_tag_action_replace_strings(tag, kv, modified);
+ if (ret) {
+ fprintf(stderr, "swf_tag_replace_action_string: swf_tag_action_replace_strings failed\n");
+ }
+ } else if (isButtonTag(tag->code)) {
+ ret = swf_tag_button_replace_strings(tag, kv, modified);
+ if (ret) {
+ fprintf(stderr, "swf_tag_replace_action_string: swf_tag_button_replace_strings failed\n");
+ }
+ } else {
+ fprintf(stderr, "swf_tag_replace_action_string: action or button tag needed.\n");
}
return ret;
}
}
return ;
}
+
+int
+swf_tag_button_replace_strings(swf_tag_t *tag, y_keyvalue_t *kv,
+ int *modified) {
+ int ret = 1;
+ swf_tag_button_detail_t *swf_tag_button = (swf_tag_button_detail_t *) tag->detail;
+ if ((tag->code == 7) && swf_tag_button->actions) { // DefineButton
+ ret = swf_action_list_replace_strings(swf_tag_button->actions, modified, kv);
+ }
+ if ((tag->code == 34) && swf_tag_button->condactions) { // DebineButton2
+ swf_button_condaction_t *button_condaction;
+ for (button_condaction = swf_tag_button->condactions->head ; button_condaction ; button_condaction = button_condaction->next) {
+ if (button_condaction->actions) {
+ ret = swf_action_list_replace_strings(button_condaction->actions, modified, kv);
+ if (ret) {
+ fprintf(stderr, "swf_tag_button_replace_strings: swf_action_list_replace_strings failed:\n");
+ return ret;
+ }
+ }
+ }
+ }
+ return 0;
+}
int indent_depth);
extern void swf_tag_button_destroy_detail(swf_tag_t *tag);
+extern int swf_tag_button_replace_strings(swf_tag_t *tag, y_keyvalue_t *kv,
+ int *modified);
+
#endif /* __SWF_TAG_BUTTON__H__ */