Yahoo! allows Flash versions 6,7,8, & 10 (AS2 & AS3) ... Open Adobe Flash CS3/
4. 2. Go to File -> New and select Flash File (Actionscript 3.0). Creating the ...
Flash Banner Ads for Actionscript 3 General Specifications •
Yahoo! allows Flash versions 6,7,8, & 10 (AS2 & AS3)
•
Non-user-initiated audio is not permitted in flash ads. Sounds played on click area okay. All sounds are subject to approval by Yahoo!.
•
For best results, we recommend having the button encompass the entire ad area throughout the entire timeline. Buttons must have the clickTAG expression (see below) in place of embedded URLs.
•
The clickTAG expression must be attached to a button object and called onRelease.
•
Do not embed any URLs in the Flash file—include linking URLs in an email or other document.
•
Make sure the dimensions of the movie meet the specs for the ad you are creating.(See http://hk.adspecs.yahoo.com)
Frame rate may not exceed 24 frames per second due to performance considerations. Banners that exceed 24 frames per second will not be accepted. 12 frames per second is preferred.
•
All Flash ads must be accompanied by the SWF file as well as an alternate image (GIF or JPG) of the same dimensions. Images must meet the file size specs for that ad size. Yahoo! makes use of HTML templates—there is no need to include HTML files with your submission.
•
Looping must be set to False.
•
Loading files from cross domains is not permitted for security reasons.
•
All Creative is subject to approval by Yahoo!.
Flash 9+ Specifications •
Streaming video is allowed when using FLV streaming format. FLV files are treated the same as additional SWF files of no more than 4 @ 100k each. All additional files must be hosted by Yahoo!.
•
The use of Clipboard is not permitted.
Privacy Policy: Yahoo! allows advertisements to collect personal identifying information; however you may be asked to make changes to the ad units or include additional disclosure in order to be acceptable for advertising on Yahoo!. If you wish to collect personal information within advertisements, those ad units will need to: 1.
Clearly identify your organization
2.
Provide a direct link to your privacy policy, adjacent to the submit button
3.
Clearly identify the purpose for collecting the information
Additional disclosure may be required, depending on the type of advertisement. Please see your advertising representative for more information on required notices. Yahoo! will also label all
廣告".
such ad units with "
Note: As stated above, cookies may not be set on the Yahoo! network except by parties with a third party ad serving agreement. Data collection must be collected by user click, leaving Yahoo! and landing to client's website. Data collection without leaving the advertisement is accepted only if the banner is served and data is stored by parties with a third party ad serving agreement.
Banner Instructions Creating a button Starting an AS3 project 1.
Open Adobe Flash CS3/4
2.
Go to File -> New and select Flash File (Actionscript 3.0)
Creating the Button 1.
Create a new layer (Insert->Timeline->Layer) above all the other layers. Select the first keyframe in that layer.
2.
Using the Rectangle Tool, draw a rectangle that encompasses the entire area of the ad.
3.
Using the Selection Tool, click on the rectangle then right-click and select Convert to Symbol. Name the symbol and choose the button behavior.
4.
In the button Properties panel, give your button an instance name. For this example, name it "myButton". This is so that the button can be referenced in the ActionScript.
5.
Double-click on the button to edit it and click drag the UP keyframe to the HIT frame.
6.
Now select Scene 1 to return to scene 1. Your button will now look like a transparent, blue rectangle.
Adding the Actionscript 1.
Create a new layer (Insert->Timeline->Layer). Name it "Code" if you like.
2.
Select the first keyframe in that layer, and activate the Actions panel (Windows->Actions).
3.
Copy and paste the code below. This defines the on click function. This function will be called upon once your button is clicked. NB: clickTAG is case sensitive.
function onButtonClick(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG, '_blank'); } else { // Any other browser if (root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG),"_blank"); } } }
4.
Use the following code to connect the function above to the button you created. This tells flash what to do once the button is clicked. This code can be placed anywhere in your Actionscript code, but makes sense to attach it to your button layer. NB: in AS3, you can no longer attach Actionscript to the button itself, only to the layer.
1 myButton.addEventListener(MouseEvent.CLICK, onButtonClick);
5.
Form Fields Forms must use a GET method, and the query string is constructed manually. Here is an example in which we pass the zip code to the clickTAG. "tf1" is the Flash input text field. Creating the Input Text Field
var tf1:TextField =
new TextField();
tf1.text="Enter Zip Code here";
// Default text of the text box
tf1.type = TextFieldType.INPUT; tf1.selectable=true; tf1.addEventListener(MouseEvent.CLICK, function(evt:MouseEvent){tf1.text="";});
// Erase
the default text when the user clicks on the box
Defining the Functions function onButtonClick(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG + "?zip=" + tf1.text, '_blank'); // Appending user-entered text to the clickTAG } else { // Any other browser if (root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG + "?zip=" + tf1.text),"_blank"); // Appending user-entered text to the clickTAG } } }
Assigning the callback
search.addEventListener(MouseEvent.CLICK, onButtonClick);
Multiple clickTAGS Defining the Functions function onButtonClick1(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG, '_blank'); } else { // Any other browser if (root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG),"_blank"); } } } function onButtonClick2(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG2, '_blank'); } else { // Any other browser if (root.loaderInfo.parameters.clickTAG2.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG2.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG2),"_blank"); } } }
function onButtonClick3(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG3, '_blank'); } else { // Any other browser if (root.loaderInfo.parameters.clickTAG3.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG3.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG3),"_blank"); } } } function onButtonClick4(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG4, '_blank'); } else { // Any other browser if (root.loaderInfo.parameters.clickTAG4.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG4.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG4),"_blank"); } } } function onButtonClick5(evt:MouseEvent):void{ var browserAgent:String = ExternalInterface.call("function () {return navigator.userAgent;}", false, false); if(browserAgent != null && browserAgent.indexOf("MSIE") >= 0){ // Detect for IE ExternalInterface.call("window.open",root.loaderInfo.parameters.clickTAG5, '_blank');
} else { // Any other browser if (root.loaderInfo.parameters.clickTAG5.substr(0,5)=="http:" || root.loaderInfo.parameters.clickTAG5.substr(0,6)=="https:" ){ navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG5),"_blank"); } } }
Assigning the callbacks
button.addEventListener(MouseEvent.CLICK, onButtonClick1); button2.addEventListener(MouseEvent.CLICK, onButtonClick2); button3.addEventListener(MouseEvent.CLICK, onButtonClick3); button4.addEventListener(MouseEvent.CLICK, onButtonClick4); button5.addEventListener(MouseEvent.CLICK, onButtonClick5);
Looping Animation
By default all flash banner does not loop in Yahoo page. If the adspec of the ad banner does allow looping animation, please use adequate Actionscript to perform looping in the flash banner. For example, adding the following Actionscript to go back to the beginning of the main timeline. MovieClip(root).gotoAndPlay(1);