Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Saturday, June 6, 2009

Flash tricks - global vars, functions, timers

Creating global var-
_global.myvar

Creating a timer-
var starttime = getTimer();
var atime=0;

while (atime < _global.timestop+starttime){

atime = getTimer();

if (_global.conn_state == true){
break;
}
}

Creating a function-
function populateJoin(){

gamelist.data = _global.currentmsg.split(_global.SEP);
gamelist.labels = _global.currentmsg.split(_global.SEP);


}

Photoshop Tricks - alpha channels and actions

Creating an alpha channel (ps cs2)-
magic lasso outside of the object
inverse select
go to channels
click save selection as channel
Now you can save with the alpha channel


Creating an action (ps cs2)-
Click the actions tab
Click new actions and click record
Do what you want to record and press stop

Automatically start action (ps cs2)-
go to file ->scripts
click scripts events manager
check the enable events to run scripts/actions
associate your action with an event

Tuesday, May 26, 2009

Create a dojo dialog widget

Sunday, April 19, 2009

Solution to generating markers along a route at a regular interval

I found this neat javascript extension for the google map api. Here is the link:

http://econym.org.uk/gmap/epoly.htm

You specify the distance and give it a polyline and it returns an array of points along the route.



map.setCenter(new GLatLng(42.351505,-71.094455), 15);
var directionsPanel = document.getElementById("directions_div");
var directions = new GDirections(map, directionsPanel);
var address = "from: trenton, nj to: philadelphia, pa";

directions.load(new_address);
if (directions == null){
alert("Error: directions object is null");
return;
}

var pl = directions.getPolyline();

if (pl == null){
alert("Error: polyline object is null");
return;
}

var points = pl.GetPointsAtDistance(1609.344);

if (points == null){
return;
}

for (var i=0; i
map.addOverlay(new GMarker(points[i]));
}