MBMedia

MBMedia

Design . Develop . Create

SEO and Mobile Friendly XML Templates

MBMedia was founded and is run today by ActionScript Developer and Graphic Artist Bryan Grezeszak. Bryan is an active author on actionscript.org and is also the inventor of the AS3 3D engine Elemental 4D. Since beginning ActionScript 3.0 when it was first created, Bryan has been recognized as an award winning author, a subject expert speaker and presenter, and an innovative inventor in the field. His expertise has a reputation for quality that has taken his name around the world, from speaking at conferences, to having his articles used as learning materials at major universities, to building projects for some of the most renowned organizations in the world. Check out his portfolio or visit the grezeszak.com flash blog for more.

SUPPORT :

Due to the large volume of questions I get, there is no way for me to offer guaranteed support. I do my best to offer great support though, especially for newer items. But if your question is answered in the documentation, item FAQ , or item comments then I may have a tendency to overlook it :) Moral of the story is that I only want to spend time helping people that are willing to spend time helping themselves. If the answer to your question wasn’t worth 5 minutes of reading to you, then it’s not worth 5 minutes of typing to me. Please read first. Also, rudeness has a zero tolerance policy. It’s doubtful I’m going to take time from my day to support you if you’re rude or degrading towards me. Be polite, read & research before asking, and I’ll do my best to make sure things work for you!

F.A.Q.

1) My Flash file works fine by itself, but when I load it into another swf it doesn’t work. What’s wrong?

This usually means that the swf you are loading and the swf doing the loading are in different folders. When flash loads in another flash file, the flash that got loaded adopts the path of the file that loaded it. So make sure any XML files or assets are relative to the loading swf.

2) I’m getting “TypeError: Error #1009: Cannot access a property or method of a null object reference.” when I load a swf into this, but the loaded swf works fine on it’s own.

Remember way long ago when you wrote it AS2 how whenever you were writing a swf that would be pulled into another swf you were really careful with _root, because it changed places? AS3 has two things like that, root (same as _root) and stage. Using either without properly thinking through the consequences can be bad. The references to stage are what I seem to be running into the most. Why? stage is only a valid reference once the loaded swf is added to the display list, via addChild. Until then it is null. A loading swf starts executing code when the first frame is ready, and it doesn’t always make sense in many template cases to add a swf until it is fully loaded, since you don’t know it’s content. Therefore it is good practice to not reference stage in the code of any swf that is designed for the purposes of being a part of a website rather than a full website, such as a contact page or an image viewer. Because it creates many possible problems for someone when they try to implement it. If you need stage in your components, try running an if statement if (stage) before using it, or only using stage on the Event.ADDED_TO_STAGE event so that you know it’s in the display list, and remember the Event.REMOVE_FROM_STAGE should then undo whatver things the Event.ADDED_TO_STAGE did, since stage will be null again.

3) I’m loading in a swf with sound or music, but when it unloads the swf, the sound is still playing. How do I get that to stop?

The original idea of what Adobe intended in AS3 for Flash 9 was that the loaded in swf would be self reliant, able to detect when it was removed and stop the sound from within itself. Use this inside the swf that is being loaded in, so that it can detect when it is removed from the stage, and therefore shut down it’s own sound:

addEventListener(Event.REMOVED_FROM_STAGE, swfWasRemoved)

function swfWasRemoved(event: Event) : void
{
  // inside this function shut down the sound that is inside the swf
}

4) Some characters like âæèêíó don’t show when I put them in the XML , why not?

Most flash files use fonts embedded in the swf. This means only the embedded characters will work. Since every extra character set adds weight to the file, it isn’t logical to embed as many as possible. So you need to embed them. Open the .fla file, select whatever textfields you want to embed the characters with, and on the properties panel press “Embed”. You will find a panel with character sets and a line to type custom characters, type whatever characters you want on that line.

5) How much can AS2 and AS3 work together, can AS2 load AS3 ? Can AS3 load AS2 ?

AS2 and AS3 are different languages. No AS2 code can be used in an AS3 project and no AS3 code can be used in an AS2 project. However AS3 files are capable of loading in independent AS2 files at runtime, but they do not communicate with each other. And AS2 cannot load in AS3 files at all.

Public Collections

View All Collections

191 Followers

Authors I Follow

by
by
by
by
by
by