Sooo… here’s a little strange nugget of information we just discovered while loading in a .txt file into Flash content using loadVars.load(): the ActiveX Flash Player in IE 6 does NOT like GZIP compression and cache-control being set to no-cache from an HTTP request. Flash also doesn’t allow you to change the response type client-side, so the only solution is to change the host. We didn’t figure this out, this guy or gal did (thank you!). Also note - he’s specifically talking about XML here, but we also had this issue with plain Text files. Needless to say, the EyeWonder staging and live environments now take this into account, so load away with those txt files!
These posts have nothing to do with one another, other than being helpful component tips, but for the sake of not overrunning this blog with more boring coding stuff :), I combined these two notes into one little article.
Adding .flv files as additional assets
Using SEPY to edit actionscript code which will be using the EW class file
Recently, several groups have brought up good scenarios where they would like to use a Flash Video File (.flv) as an additional asset for their ad instead of using the AdWonder component. Most of these have to do with the fact that the videos are: really short and rather small. The reason these videos are not good candidates for using our videoScreen component is because tracking is rather silly since the videos are so short you’re going to see 100% view-through rate, and you’re probably tracking the button that starts them if there is one. Also, bandwidth detection doesn’t really apply since the video is small enough to behave rather well regardless of bandwidth.
Because of all this, you may now add small FLVs (under 100k) as additional assets to your ads. To reference the absolute path of this video, you may use the following: path = EW.baseURL+”blah.flv”; Please note the following: FLVs will be checked to make sure they are smaller than 100k, we cannot guarantee that sites which require streaming will accept this, and you will need to publish the ad through our component panel for local testing to work appropriately.
Secondly, many of our users are devoted ActionScript developers, and, as such, they have their own methods for editing ActionScript code with other applications. Some have asked recently about SEPY and if they can use it in conjunction with our EyeWonder code hints. After a quick search around the office, one of our developers (thanks Justin) noted that this is just as easy as adding the path to our class file using SEPY’s autocompletion classpath. If anybody has used this and liked it a whole lot, be sure to let me know!
Classpath on a PC using Flash 8: C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes
Classpath on a PC using Flash CS3: C:\Documents and Settings\[username]\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\EyeWonder\AS2Classes\
Classpath on a Mac using Flash 8: [username]/library/Application support/Macromedia/Flash 8/en/Configuration/Classes
Classpath on a Mac using Flash CS3: [username]/library/Application support/Adobe/Flash CS3/en/Configuration/EyeWonder/AS2Classes/
There are countless articles written about this, but for some reason none of the ones I saw made mention of the solution I needed, so I thought I’d just send out this tidbit to everyone so that it is floating around somewhere in our searchable world.
So let’s say you have created a flash file that has a form in it, and then customized it, etc. It’s pretty, customized, the right size, and most importantly *working*. Then, you decide to load said-file into a parent swf. FLASHING RED FLAG - the comboBox doesn’t work anymore. Perhaps it’s unselectable, maybe it shows but the default value doesn’t show, or maybe there is some other weird thing. Check for the following:
1. The comboBox needs to live in the Library of the _root swf. You can accomplish this by copying and pasting the component into the first frame of the _root swf and then deleting it. Or, just copy it into the library directly.
2. Some forums suggested making sure the movieclip that is storing said component should persist throughout the timeline. While I don’t think that was the problem I ran across, it’s worth mentioning.
3. Lastly, and MOST important. The movieclip containing the comboBox cannot be masked. Don’t even think about masking the movieclip which loads in the movieclip which contains the comboBox. It won’t work if there is masking on the comboBox at any level.
So… hopefully this helps somebody. I know it would have helped me if somebody else had written it all out somewhere. Best of luck! And, creatively speaking, I would suggest just making your form contain input text instead and call the whole thing a day. Deal with authentication in actionscript or server-side and forget the whole thing
With Flash 8 and above, adding video events and cue points has become even easier. EyeWonder welcomes the use of more recent improvements to video functionality and encourages its use, so please follow the information below to create an ad which uses video cue points as opposed to the custom EyeWonder events associated with the AdWonder videoScreen component.
Because of some other constraints and issues that come up if a netStream object isn’t created and destroyed upon video playback, the netStream object which is encapsulated by the videoScreen object is created dynamically upon playback. Follow the steps below to add a listener for cue points with an AdWonder videoscreen object.
video_ew.addEventListener("playbackStart",setCues); //checks for when the netStream object has been created
function setCues() {
video_ew.ew_netStream.onCuePoint = myCuePointListener; //dynamically setting the cuePoint to the created netStream object
}
myCuePointListener = function (infoObject:Object) { //your function
EW.sendToPanel(infoObject.name); //shows the name of the cue point as embedded in your video
if (infoObject.name == "[name of cue Point]“) {
//do whatever happens on this cue Point
}
};
Note: if you are planning on using cue points, please alert your EyeWonder rep prior to sending the encoded file or source file so that the encoding team is aware of embedding cue points.
One other cool thing while I’m here (and look for these in the next component templates release for a real world example). I was just reminded when helping out one of our EyeWonder flash dudes that there is a very handy clickthru event. Since the browser interprets focus differently depending on your OS, etc., it is wise to go ahead and contract the expandable units whenever your users have clicked through so that they have a nice clean page to come back to. There is an event (”clickthru”) which is accessible through the EW object regardless of scope that you can use to perhaps close the expandable, do something else, etc., on any and all clickthrus in the unit. This is especially useful when you have multple clickthrus speckled throughout the unit and would like to handle them all the same way:
EW.addEventListener(“clickthru”, listener); //calls an event listener for all clickthrus, regardless of scope
function listener() {
onMouseOut(); //close the expandable
}
If you have created Expandables with some of our competitors, you may be used to creating ads with a closed state and an opened state because that is the way their system is setup. While we definitely recommend setting up the files with one parent swf and child swfs so that you have animation control between expands and contracts, as well as more communication between the closed and panel units, it is understandable that you may have assets which were already set up with open and closed swfs.
EyeWonder has a good trick on how to get around this, so please see below for more info on how to quickly turn your two swfs into a parent/child combo. Let’s say that you have a 728×90 and a 728×270 swf which you need to combine:
Take the 728×90 swf and select the entire timeline.
Copy the frames.
Create a new movieclip in the library.
Paste all the frames into the movieclip.
Create a new “parent” swf which is set up for the entire stage (like 728×270)
Add the assembled movieclip into the library and put into the content layer.
Create a timeline that looks like this:
Note that you will want to edit the rollover area to go wherever the rollover is going to be. If the rollover doesn’t become visible until partially through the main animation, add the visible/not visible to the closed timeline.
Your expand code will look like this:
var startExpandFrame = 2; rollover_mc.onRollOver = function(){
Change all previously written actionscript from “_root” to “_parent”. If that doesn’t work, you can always fix the scoping by setting a variable to the scope). For instance, add this line of code: “var closed_scope = this;” to the main timeline of the movieclip you created and then find and replace all the “_root” instances to “closed_scope”
You may want to disable/enable the rollover in different points along the timeline. For that call _root.rollover_mc._visible = true or false;
One of our Component Support Specialists, Meng, sent this out to the creative services team. I think this is something helpful for all AdWonder users, check it out:
The differences between on (release) and mybutton_btn.onRelease() = function When we code something as a FRAME actionscript such as:
This code snippet will perform the follow task: set the value of the Boolean variable clicked to true
But in ActionScript, there’s always two ways to accomplish the same task using different ways, such as a CLIP ActionScript (the script is on the _btn)
on (release) {
clicked = true;
}
This code snippet will “seem” to perform the same task as above, but in practice, because it’s embedded in a on (release) handler, the scope of the function is now WITHIN the button object, so clicked = true; only creates a local variable named clicked and names it to true, instead of setting the _root.clicked to true. The correct code should be _root.clicked = true;
on (press) vs. on (release)
on the surface it’s the same, a mouse click event capture function, but the other than the major difference of on(press) will trigger upon mouse button “down” and on (release) will only fire with the mouse button “up” action, in practice they induce very different effects.
For example:
on (press) { EW.clickThru(“clickTag1”, “button click”); } //This will be caught with a variety of browser’s popup blocker
on (release) { EW.clickThru(“clickTag1”, “button click”); } //This is much safer and usually will not be blocked