Knowledge Base |
Important! All new questions are usually answered within the next business day.
TxEff AS3.0
(views: 8650)
TxEff is a AS3.0 Flash Component especially developed for web designers that need to include text animations within their Flash movies in a fast and reliable manner.
Main TxEff animation loads external TxEff animations
(2008-04-14 - views: 580)
Q: If there is main .swf file that contains a TxEff animation with the Blur pattern and this main .swf file loads several other external .swf files, all containing TxEff animations with different external patterns, there will be "pattern unavailable" error message displayed in the output panel. This happens even if all the external patterns used, are placed correctly in the Library of each external .swf file. The error message disappears if I place all the external patterns into the Library of my main file.
How should the external TxEff animations be loaded correctly so there won't be the need to place all the patterns I use, into the Library of the main .fla ?
How should the external TxEff animations be loaded correctly so there won't be the need to place all the patterns I use, into the Library of the main .fla ?
A: When the external .swf files are loaded by the Loader instance, they are loaded into a different application domain, so when those TxEff instances look for their patterns in the Library, they no longer find them and the "pattern unavailable" error message is displayed into the Output panel.
To solve this issue, the external .swf file containing your TxEff animation should be loaded into the same application domain as the main .fla:
// Create a new loader context with the application domain as the current
// application domain.
var addedDefinitions:LoaderContext = new LoaderContext();
addedDefinitions.applicationDomain = ApplicationDomain.currentDomain;
// Create the Loader object that will load your external .swf file.
var ldr:Loader = new Loader();
var url:String = "external_anim.swf";
var urlReq:URLRequest = new URLRequest(url);
// Load the .swf file with the new loader context.
ldr.load(urlReq,addedDefinitions);
addChild(ldr);
Each of your external animations should be loaded like that, with the above loader context settings.
As for the embedded font. the main file should embed into it all the characters used by the TxEff animations of the external files. In this case the external .swf files do not need to have the characters embedded for the TxEff animation. Those characters will be taken from the main file.
To solve this issue, the external .swf file containing your TxEff animation should be loaded into the same application domain as the main .fla:
// Create a new loader context with the application domain as the current
// application domain.
var addedDefinitions:LoaderContext = new LoaderContext();
addedDefinitions.applicationDomain = ApplicationDomain.currentDomain;
// Create the Loader object that will load your external .swf file.
var ldr:Loader = new Loader();
var url:String = "external_anim.swf";
var urlReq:URLRequest = new URLRequest(url);
// Load the .swf file with the new loader context.
ldr.load(urlReq,addedDefinitions);
addChild(ldr);
Each of your external animations should be loaded like that, with the above loader context settings.
As for the embedded font. the main file should embed into it all the characters used by the TxEff animations of the external files. In this case the external .swf files do not need to have the characters embedded for the TxEff animation. Those characters will be taken from the main file.
User Comments
how about the size?
Indeed, each external .swf will contain the TxEff component but their size but that will not increase the loading swf's size. If you want to avoid compiling the TxEff into each external .swf file, you could try to compile them without the TxEff (of course the animations won't work) and include the component only into the loading .swf. In this case you shouldn't change the application domain.
posted by negush on 2008-05-30
Indeed, each external .swf will contain the TxEff component but their size but that will not increase the loading swf's size. If you want to avoid compiling the TxEff into each external .swf file, you could try to compile them without the TxEff (of course the animations won't work) and include the component only into the loading .swf. In this case you shouldn't change the application domain.
Login to post your comment
Other questions in this item:
Using Pattern Transitions Flash player version with AS3 Show and hide the text, using ActionScript Get new patterns "pattern is unavailable" error message Different patterns in & out Text and transition not displaying Apply transitions on multiple text from xml file TXEFFEvents Properties Cannot import effects from site Keep CSS (a:hover) on text after effect Setup TxEff from .xml file Preload TxEff animations Apply filters on TxEff animation Flash player version with AS2 Simple show and hide effect on time line TxEff pattern does not snap to text field Setup properties don't display in the Component Inspector Bought the Full TxEff License but only have three patterns in the patterns listMenu |
|
|


in this case, the several external animation swf will compile the same TXEFF component for several times. and the files size will be huge.
do you have any idea to avoid compile the same TXEFF, like flash DLL? can u give us a example ?