attachSound() Won’t Play in Loaded Movie- Another Flash Bug!


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallBeforeHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 218

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 53

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 54

Warning: shuffle() expects parameter 1 to be array, null given in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/wordpress-support/wordpress-support.php(10) : runtime-created function(1) : eval()'d code(1) : eval()'d code on line 1

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallAfterHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 226

I came across this bug awhile ago. Lets say you had the following code in a SWF:

noise = new Sound();
noise.attachSound("asound");
noise.start();

It worked perfectly, the sound with the linkage ID in my library names “asound” played and everything was great.
Now try loading that SWF info another SWF, the sound will not play. I searched the net and found this nice little comment here:


“For what it is worth, I had the same issue, and found a solution to this.
When declaring the “new Sound”, you have to specify a target movie clip. For example:
new_sound = new Sound(this)”

Ah-Ha! Specifying this in the Sound object’s constructor magically makes it work. This isn’t anywhere in MM’s docs. Thanks MM for wasting 30 more minutes of my time!

1 Responses to “attachSound() Won’t Play in Loaded Movie- Another Flash Bug!”



  • Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallBeforeHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

    Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 218

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 53

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 54

    Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallAfterHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

    Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 226

    Ok, so it doesn’t tell you in exactly those words, but it sort of does tell you.

    “Constructor; creates a new Sound object for a specified movie clip. If you do not specify a target instance, the Sound object controls all of the sounds in the movie.”

    So basically if your Sound() object does not have a target, it becomes global, which is a no no for attachments unless you feel like getting into Shared Libraries.

    Though honestly, their description is very vague, and they should make note of it at least in their attachSound() description. I hate when help documents assume you don’t need help.

    So yes… THANKS MM FOR WASTING 30 MOTE MINUTES OF HIS TIME!

Leave a Reply





Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2::init_scripts() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 405