add multiple buttons addListerner AS3
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.events.MouseEvent;
import flash.text.TextFormat;
for (var btn:int = 1; btn < 7; btn++) {
this["spot" + btn].buttonMode = true;
this["spot" + btn].addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this["spot" + btn].addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
function onMouseOver(event:MouseEvent):void
{event.currentTarget.play();}
function onMouseOut(event:MouseEvent):void
{event.currentTarget.gotoAndStop(1);}
getChildByName
var labelArr:Array = new Array();
var i;
for (i=1;i<15 i="" nbsp="" p=""> labelArr.push("ins"+i);
}
for(i=0; i { var tempName = labelArr[i];
MovieClip(root).s.getChildByName(tempName).visible = false;
}
for(i=0; i { tempName = labelArr[i];
MovieClip(root).s.getChildByName(tempName).visible = true;
}
15>
var i;
for (i=1;i<15 i="" nbsp="" p=""> labelArr.push("ins"+i);
}
for(i=0; i
MovieClip(root).s.getChildByName(tempName).visible = false;
}
for(i=0; i
MovieClip(root).s.getChildByName(tempName).visible = true;
}
var button:MovieClip;
for (var i=1; i<7 btn="" button.addeventlistener="" button.buttonmode="true;" button="MovieClip(getChildByName(" code="" i="" objclick="" objout="" objover="" ouseevent.click="" ouseevent.roll_out="" ouseevent.roll_over="">7>
push multiple buttons in array
var labelArr:Array = new Array();
for (i=1;i<50;i++){
labelArr.push("button"+i);
}
for(var i=0; i<labelArr.length; i++)
{ trace(labelArr[i]);
}
read more : https://github.com/asimkh/projects
format your code: http://codeformatter.blogspot.ae/
Tube Teaching: Add Interactive Chapters to a YouTube Video
Tube Teaching: Add Interactive Chapters to a YouTube Video: Use the Annotations tool to apply chapters to a YouTube video. Click the title of each chapter to jump to its section. You will nee...
AS3 and Jquery flash plugin
$(document).ready(
function() {
jQuery('#tabs').tabs();
var params = parseQueryString();
var user = params["user"]
$('#tab-5').flash({swf:'swf/flash.swf',height:525,width:928,wmode:'transparent',flashvars: { pma3 : user}});
}
)
AS3
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.external.ExternalInterface;
click_btn.addEventListener(MouseEvent.MOUSE_UP, onClick);
click_btn.buttonMode = true;
function onClick(e:MouseEvent):void {
var pmaUser:String = root.loaderInfo.parameters.pma3;
var myURL = pmaUser;
ExternalInterface.call("console.log", myURL);
if(pmaURL) {
navigateToURL(new URLRequest(myURL), '_blank');
}
}
function() {
jQuery('#tabs').tabs();
var params = parseQueryString();
var user = params["user"]
$('#tab-5').flash({swf:'swf/flash.swf',height:525,width:928,wmode:'transparent',flashvars: { pma3 : user}});
}
)
AS3
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.external.ExternalInterface;
click_btn.addEventListener(MouseEvent.MOUSE_UP, onClick);
click_btn.buttonMode = true;
function onClick(e:MouseEvent):void {
var pmaUser:String = root.loaderInfo.parameters.pma3;
var myURL = pmaUser;
ExternalInterface.call("console.log", myURL);
if(pmaURL) {
navigateToURL(new URLRequest(myURL), '_blank');
}
}
ScrollPanel component as3
import fl.containers.ScrollPane;
import fl.controls.ScrollPolicy;
import fl.controls.DataGrid;
import fl.data.DataProvider;
var aSp:ScrollPane = new ScrollPane();
var aBox:MovieClip = new MovieClip();
drawBox(aBox, 0xFF0000);
aSp.source = google;
aSp.setSize(480, 480);
aSp.move(0, 0);
addChild(aSp);
function drawBox(box:MovieClip,color:uint):void {
box.graphics.beginFill(color, 1);
box.graphics.drawRect(0, 0, 480, 480);
box.graphics.endFill();
}import fl.containers.ScrollPane;
function updateScroller() : void
{sourcecontainer.source = google;
sourcecontainer.update();
sourcecontainer.verticalScrollPosition = sourcecontainer.maxVerticalScrollPosition;}
updateScroller();