function createDiv(obj){
var gen = document.createElement("div");
gen.id = obj.id;
gen.style.top = obj.top + "px";
gen.style.left = obj.left + "px";
gen.style.width = obj.width + "px";
gen.style.height = obj.height + "px";
gen.style.position = "absolute";
gen.style.pointerEvents = "none";
if(obj.bkg) gen.style.background = obj.bkg;
if(obj.parent) obj.parent.appendChild(gen);
return gen;
}
Send back chuncks from an array
var catImgs = ["1", "2", "3", "4", "", "6", "7", "8"];
var arr = newArray(catImgs,4);
function newArray(arr, count){
var temp = [];
var temp2 = [];
var current = 0;
for(var i = 0; i < arr.length; i++){
var obj = new Object
obj.id = i;
temp.push(obj);
}
for(var j = 0; j < Math.ceil(temp.length / count); j++){
temp2.push(temp.slice(current, current + count))
current += count;
}
return temp2;
}
Awesome time-lapse video.
[media link=”http://vimeo.com/51430433″]
[media link=”http://vimeo.com/51052640″]
[media link=”http://vimeo.com/51052639″]
[media link=”http://vimeo.com/51052641″]
You will need tweenlite for this to work.
You can set the menu items via an array and disable the current button that is pressed.
if you want you can set the URLS in an array and have the selected button pull the URL from your array, right now it’s not being set to do that.
but it would go something like this.
var links:Array = new Array(“link1″,”link2″,”link3″);
then in setNav Function change the URLRequest to
navigateToURL (new URLRequest(links[thisOne]),”_blank”);
import flash.events.MouseEvent;
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
import com.greensock.OverwriteManager;
import flash.display.MovieClip;
OverwriteManager.init();
TweenPlugin.activate([TintPlugin]);
var btns:Array = new Array(“home”,”away”,”long”,”about”,”links”,”bio”);
//var links:Array = new Array(“link1″,”link2″,”link3″);
var xPos:Number = 1;
var yPos:Number = 40;
var distance:Number = 1;
var delayBtn:Number = .1
Read the rest of this entry »
Change colors for multiple items in your flash file, textField, movieClips, whatever.
//change color for multiple items
var newColor:Number = 0xDAE2EE;
mcChange = [mc_1, mc_2, mc_3, mc_4, mc_5];//or add text field textField
for (i=0; i<mcChange.length; i++) {
var mainColor:Color = new Color(mcChange[i]);
mainColor.setRGB(newColor);
}
So you want to remove multiple characters or words from a string, here’s a simple way to get job done. ActionScript 2.0
var myString:String = “noe noeone chicago”;
var dontNeed:String = “noe ,?,-,:,/,’,&”;
var myArray:Array = new Array();
myArray = dontNeed.split(“,”);
trace(“character or words not needed : “+myArray);
for (i=0; i<myArray.length; i++) {
//remove unwanted characters
newString = myString.split(myArray[i]).join(“”);
myString = newString;
trace(myString);
}
This is a cool video using Tilt Shift Effect.
Bathtub IV from Keith Loutit on Vimeo.
Recent Comments