Cleaning Up A String, From "www.mysite.com/page1.htm" To Just "page1"
anybody know to clean up a string like that and remove all the unwanted crap?
so var1 = www.mysite.com/page1.htm
and would like a method that just leaves me with say var2 = page1
cheers
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-10-2005, 12:08 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_root.gotoAndPlay("page1");
in flash mx...
where can u find this script
_root.gotoAndPlay("page1");
coulndt find it...
and can i ask whats _root means?
Loadmovie --- Http://www.mysite.com ::: Http://mysite.com
Ok, I'm aware that when using loadmovie and embedding your main Flash movie into HTML, absolute URLs are best used.
Does anyone know why they only work with the http://www prefix rather than http:// ?
Or more importantly, anyone know how I can get round it?
Here's a couple of examples:
http://www.telekin.co.uk/outback/
http://telekin.co.uk/outback/
Click on one of the 3 boxes in both instances and you'll see what I mean.
I've tried searching but got nowhere. Anyone else had this problem?
Thanks in advance!
Help With Rtmp://www.mysite.com/Cams/
Hi This is a webcam videoconference swf I have made from the sample_videoconference on my mx comunication server.
It works great on my html, php, & direct from the swf. I have tried it on wan and lan it works on both. My Problem is
I cant get it to work inside my flashchat project Anyone any ideas?
There is no error it just will not let you login to the webcam. But a webcam window does appear telling me to login.
If anyone wants to take alook or can help post here or email me as I have to give you a url & username and password for my chat
Crosz@btinternet.com
GetURL "www.mysite.com/" + User Input
Using FlashMX, I'd like to create a simple input field that let's a client input their client code. Upon submitting that code they would then be transported to an html page http://www.mysite.com/[client code]. I've tried searching the site to find information on doing this, but haven't had much luck. Can anyone give me a hand or point me in the right direction? Much appreciated.
Cleaning Up For GC
Hi. So, I'm trying to recursively clean up some objects so they can be garbage collected, and I have the following code in one class..
ActionScript Code:
// Destroy all references so GC can collect
public function destroy():void {
while(numChildren > 0) {
var object = getChildAt(0);
if (object is IDestroyable) {
object.destroy();
}
removeChild(object);
}
removeEventListener(Event.ENTER_FRAME, drawLine);
spriteList = null;
_startPoint = null;
_endPoint = null;
addEventListener(Event.ENTER_FRAME,function () {trace("Still alive =( ")},false,0,true);
}
and of course, it is still alive, even after an obvious GC has occurred (watching a memory graph). spriteList was an array of sprites and with start/end Points are the only object references in the class. Am I doing something incorrectly?
Subtle memory leaks are annoying
Cleaning Library
Hey Everybody,
I want to clear out my library of all the junk that I'm not using in my movie. Is there a way to do it without manually doing it myself? I'm afraid if I do it I will delete stuff I need. (It never fails when I try.)
I'm using Flash MX.
THANKS!
Christina
Cleaning Up Code...
Hi i'm trying to reduce the number of lines in my code and would like to go from this: -
for (i=0;i<jobnos_array.length;i++){
trace (jobnos_array[i])
}
for (i=0;i<jobtitles_array.length;i++){
trace (jobtitles_array[i])
}
for (i=0;i<location_array.length;i++){
trace (jobtitles_array[i])
}
Etc etc
to this: -
for (i=0;i<jobnos_array.length;i++){
trace (jobnos_array[i])
trace (jobtitles_array[i]
trace (location_array[i]
Etc etc
}
But apparently its not that easy! All arrays are exactly the same size, but thats irrelevant I would just like to know how to tie multiple commands under the same 'for' statement rather than repeating it each time. Thanks
Help With Cleaning Up Code
What I'm trying to do is have an progress indicator for 10 or more sounds that play one after the other in different frames. I need help with making the code more simple because if I have 10 sounds, the "if" part becomes very confusing. Also how can I trace the total duration of 10+ sounds in an easy way. The code otherwise runs perfectly.
Code:
for (i=1; i<4; i++) {
_root["mp3sound0"+i] = new Sound();
_root["mp3sound0"+i].attachSound("sound0"+i+".mp3");
}
mp3sound01.start();
mp3sound01.onSoundComplete = function() {
nextFrame();
};
this.onEnterFrame = function() {
if (((mp3sound01.duration)+(mp3sound02.duration)) != ((mp3sound01.position)+(mp3sound02.position))) {
percentage = Math.round(((((mp3sound01.position)+(mp3sound02.position))*100)/((mp3sound01.duration)+(mp3sound02.duration)))*10)/10;
indicator._x = bar._x+((bar._width/100)*percentage);
}
};
stop();
trace(mp3sound01.duration);
trace(mp3sound02.duration);
trace((mp3sound01.duration)+(mp3sound02.duration));
Cleaning Up The Library
If I have converted a jpg into a symbol can I remove the original jpg from the library? I am trying to clean things up a bit but don't want to mess everything up.
Also is there a way to change my jpg's into vector graphics? I know with a bitmap you can use the trace bitmap feature and this will reduce file size, I am wanting to do this with all my jpgs. Is it possible? How?
Clocks Need Cleaning
Hey -
I'm making a new site that's time oriented. I've found around 15 or so flash clocks that need someone to go inside them and reset to 12 hours cycles (non-military) and add my logo.
Where might I find someone to do this for a few bucks...say $10?
Thanks
Cleaning Things Up
Is there a way to clean out the library? I have a lot of items in my library but i know that i haven't used all of them in the flash file. I was trying to clean it up just for organization purposes. How do i tell which objects are being used by the file and which ones are unnecessary? Thanks!
[F8] Cleaning Your Library?
Possibly a stupid question... but is there a way to see what's actually being used in your library? I have alot of stuff in there and obviously I wanna cut down what I don't need for better performance. Is there any easy way to do this basically?
Cleaning Out The Library
I've been hearing and reading conflicting info... Does deleting unused library items help optimize a .swf? Or, is Flash smart enough to only take what it needs?
Thanks in advance.
Help Cleaning This Code
I'm relatively new to AS3 and learning. I would like to know how to reduce this code by maybe using arrays or loops? and still work the same. I'm using Tweener here. I pasted 2 of 6 buttons actions and if I wanted to make 6 or more buttons seems like alot of code?
Code:
import caurina.transitions.*;
but1.addEventListener(MouseEvent.ROLL_OVER, PopIn1);
but1.addEventListener(MouseEvent.ROLL_OUT, PopOut1);
function PopIn1(e:MouseEvent):void {
Tweener.addTween(glow1, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(step1, {scaleX:1, scaleY:1,delay:0.61,time:0.5,transition:"easeInOut Sine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0.5, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.7, transition:"easeInOutSine"});
lines.sublines.play()
step1.lines.sublines.play()
arrow1.gotoAndPlay(2);
}
function PopOut1(e:MouseEvent):void {
Tweener.addTween(step1, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
lines.sublines.stop()
step1.lines.sublines.stop()
}
but2.addEventListener(MouseEvent.ROLL_OVER, PopIn2);
but2.addEventListener(MouseEvent.ROLL_OUT, PopOut2);
function PopIn2(e:MouseEvent):void {
Tweener.addTween(text2, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(step2, {scaleX:1, scaleY:1,delay:0.5,time:0.5,transition:"easeInOutS ine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.65, transition:"easeInOutSine"});
arrow2.gotoAndPlay(2);
}
function PopOut2(e:MouseEvent):void {
Tweener.addTween(step2, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text2, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
}
Need Some Help Cleaning This Code
Hey all, I can't say that I'm new to AS3, I've been working with it alot, and doing loads of stuff with it, and it's great so far, but one thing I have always had trouble with, is the amount of code I use. I'm pretty sure there is a cleaner, simpler way of doing things, but I guess I'll have to learn a bit at a time.
So I'll start here.
This is part of the code I'm using for a little experiment that I've put together. It works fine, just needs cleaning.
There is a single movieclip on the stage, and to start, it is duplicated to 4 childs. These childs have 4 seperate rotations (0,90,180,270) and then they are duplicated lots of times on those settings, using a timer.
I was sure that I saw a simpler way of doing this somewhere, but I really can't remember where I saw it, and I haven't the foggiest what I need to look for, simply because I don't know what it's called.
I'll also add the fla file, just in case.
Any help would be awesome! Thanks guys!
ATT: Light_Rotation.fla
Code:
function createTrailBall(e:Event):void {
// Create Child1 and add info
var trailBall1:Orb=new Orb();
trailBall1.x = trailPosition;
trailBall1.y = trailPosition;
trailBall1.rotation = 0;
// Create Child2 and add info
var trailBall2:Orb=new Orb();
trailBall2.x = trailPosition;
trailBall2.y = trailPosition;
trailBall2.rotation = 90;
// Create Child3 and add info
var trailBall3:Orb=new Orb();
trailBall3.x = trailPosition;
trailBall3.y = trailPosition;
trailBall3.rotation = 180;
// Create Child4 and add info
var trailBall4:Orb=new Orb();
trailBall4.x = trailPosition;
trailBall4.y = trailPosition;
trailBall4.rotation = 270;
[color="DimGray"]
//Start the next function for rotation and alpha changes
trailBall1.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall2.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall3.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall4.addEventListener(Event.ENTER_FRAME,animateTrailBall);
//Add Childs to stage
addChildAt(trailBall1,0);
addChildAt(trailBall2,0);
addChildAt(trailBall3,0);
addChildAt(trailBall4,0);
}
// Function for changeing Childs on stage
function animateTrailBall(e:Event):void {
e.target.rotation += rotationSpeed;
e.target.alpha -= 0.01;
if (e.target.alpha <= 0) {
e.target.removeEventListener(Event.ENTER_FRAME,animateTrailBall);
removeChild((MovieClip)(e.target));
}
}
Class Cleaning
I'm loading a movieClip that has a class attached to it which extends MovieClip.
Inside this class I create another class instance in a reference variable.
Now if I delete this movieClip prom the stage will it delete the class attaches to it and all the variables in it, plus the reference variable to the instance class inside that attached class?
Hope this makes sence
Thanks
Cleaning Up This Loop.
I got a rather long and uncool loop that I'd like to see shortened so it's just one if statement..
ActionScript Code:
function sortCards() {
//Associates 10 picture frames with the different cards.
for (i=0; i<20; i++) {
if (pictureNum[i] == 1 || pictureNum[i] == 2) {
frame = 2;
} else if (pictureNum[i] == 3 || pictureNum[i] == 4) {
frame = 3;
} else if (pictureNum[i] == 5 || pictureNum[i] == 6) {
frame = 4;
} else if (pictureNum[i] == 7 || pictureNum[i] == 8) {
frame = 5;
} else if (pictureNum[i] == 9 || pictureNum[i] == 10) {
frame = 6;
} else if (pictureNum[i] == 11 || pictureNum[i] == 12) {
frame = 7;
} else if (pictureNum[i] == 13 || pictureNum[i] == 14) {
frame = 8;
} else if (pictureNum[i] == 15 || pictureNum[i] == 16) {
frame = 9;
} else if (pictureNum[i] == 17 || pictureNum[i] == 18) {
frame = 10;
} else if (pictureNum[i] == 19 || pictureNum[i] == 20) {
frame = 11;
}
_root["card"+i].pictureNum = frame;
}
}
Cleaning Up Listeners.
Hi,
Got a class which instantiates another class multiple times. To each instance it adds 4 event listeners - onReady, onMinimised, onSelect and onClosed.
When the onClosed event is fired it destroys the instance, but is there a nice way to clear up the 4 listeners?
Thanks
Cleaning Up Code
I have this function with allot of if's statements, I'm wondering if there is a way to clean it up so it is more efficient, and less lines of code.
ActionScript Code:
function onBtnDown():void {
var imageBox:MovieClip = this["box_"+btnRef];
MovieClip(this.parent.parent).portRefPos = ((myPageRef*5) - 5) + btnRef;
if (MovieClip(this.parent.parent).portOld != imageBox) {
MovieClip(this.parent.parent).portOld = imageBox;
if (MovieClip(this.parent.parent).myMovieSection != MovieClip(this.parent.parent).portSelection) {
MovieClip(this.parent.parent).mainContent_mc.gotoAndPlay("Unload");
MovieClip(this.parent.parent).myMovieSection = MovieClip(this.parent.parent).portSelection;
} else if (MovieClip(this.parent.parent).myMovieSection == MovieClip(this.parent.parent).portSelection) {
if (MovieClip(this.parent.parent).portRefPos != MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.refPos) {
MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.gotoAndPlay("Current Reload");
}
}
} else if (MovieClip(this.parent.parent).portOld == imageBox) {
if (MovieClip(this.parent.parent).myMovieSection != MovieClip(this.parent.parent).portSelection) {
MovieClip(this.parent.parent).mainContent_mc.gotoAndPlay("Unload");
MovieClip(this.parent.parent).myMovieSection = MovieClip(this.parent.parent).portSelection;
} else if (MovieClip(this.parent.parent).myMovieSelection == MovieClip(this.parent.parent).portSelection) {
if (MovieClip(this.parent.parent).portRefPos != MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.refPos) {
MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.gotoAndPlay("Current Reload");
}
}
}
}
Help Cleaning A File
Hey all,
I have a question for you getting into Geom/Trig and getting a dynamic equation to work with a geoboard I'm making. It's still kind of in the beginning stages, and I have the initial band laying more or less working, but the "wrap" effect is a little screwy, and I'm not really sure what's going on.
Basically, if you choose to lay a band at a 45ş angle, it will work just fine. Get outside of that, and it gets a little screwy, but still workable. The biggest problem is that (based on the bass-ackerds Flash Cartesian Plane) if you run a line to quadrant 2 || 3, then it reverses the "wrap around" code, and so it wraps inwards instead outwards.
So the question is, is there anything you guys can suggest to get this working all the time? And possibly clean up my Math a bit as well... I haven't done serious Geom/Trig in about 15 years or so, and I don't know that what I am attempting is actually the best way to go about what I am trying to do.
The file is below, but here's the "problematic" code:
ActionScript Code:
function findTanLine(pinNum:Number,lastPoint:Boolean):Object {
var tanLineInfo:Object = new Object;
var point1:Point;
var point2:Point;
var angle:Number;
var perpendicularAngle:Number;
var oppositeLength:Number;
var adjacentLength:Number;
var curveXLength:Number;
var curveYLength:Number;
var radius:Number = 5;
var invert:Boolean;
if (!lastPoint) { //used to determine if it's the last "point" in the band. This is only really necessary
//to determine orientation, so that I can calculate the correct control points in the correct order.
point1 = bandArray[bandNumber][pinNum];
point2 = bandArray[bandNumber][pinNum+1];
} else if (lastPoint) {
point1 = bandArray[bandNumber][pinNum];
point2 = bandArray[bandNumber][1]; //this is the "first" point, so it also acts as the "closing" point.
}
var pointX:Number = point2.x-point1.x; //used to triangulate so I can get the X/Y lengths and get the angle.
var pointY:Number = point2.y-point1.y; //used to triangulate so I can get the X/Y lengths and get the angle.
angle = Math.atan2(pointY,pointX); //Gets the angle of the band
trace(angle+": Angle");
perpendicularAngle = angle+((3*Math.PI)/2); //gets the perpendicular bisector. I THINK I could use PI/2 as well, but no tested.
oppositeLength = radius*Math.sin(perpendicularAngle); //gets the X/Y of the tangential.
adjacentLength = radius*Math.cos(perpendicularAngle);
curveXLength = radius*Math.sin(angle); //this gets the X/Y of an extension of the original line.
curveYLength = radius*Math.cos(angle);
trace((point2.x+curveXLength)+": DeltaX;
"+(point2.y+curveYLength)+": DeltaY;");
tanLineInfo.pointOneX = point1.x+adjacentLength; //X of start of Tangent line
tanLineInfo.pointOneY = point1.y+oppositeLength; //Y of start of Tangent line
tanLineInfo.pointTwoX = point2.x+adjacentLength; //X of end of the Tangent line
tanLineInfo.pointTwoY = point2.y+oppositeLength; //Y of end of the Tangent line
//This is the part that I'm REALLY not sure about. This is to return the build points so the line curves around
//the "pins". Something is wrong with it, and it needs to be cleaned and/or simplified. As things are, on the
//first pass, if the change in X (pointX) is negative, then it seems to invert the "curve" points, and so it curves
//inward around the pin, instead of outward around the pin. It's also dependant on whether or not it's the last point.
//I think the idea is sound, but the practice is wrong...
if (!lastPoint && angle>0) {
tanLineInfo.curveXPoint = point2.x+curveXLength;
tanLineInfo.curveYPoint = point2.y+curveYLength;
tanLineInfo.controlCurve1X = point2.x-oppositeLength+curveXLength;
tanLineInfo.controlCurve1Y = point2.y-adjacentLength+curveYLength;
tanLineInfo.controlCurve2X = point2.x+oppositeLength+curveXLength;
tanLineInfo.controlCurve2Y = point2.y+adjacentLength+curveYLength;
} else if (!lastPoint && angle<=0) {
tanLineInfo.curveXPoint = point2.x-curveXLength;
tanLineInfo.curveYPoint = point2.y-curveYLength;
tanLineInfo.controlCurve1X = point2.x+oppositeLength-curveXLength;
tanLineInfo.controlCurve1Y = point2.y+adjacentLength-curveYLength;
tanLineInfo.controlCurve2X = point2.x-oppositeLength-curveXLength;
tanLineInfo.controlCurve2Y = point2.y-adjacentLength-curveYLength;
} else if (lastPoint && angle>0) {
tanLineInfo.curveXPoint = point2.x-curveXLength;
tanLineInfo.curveYPoint = point2.y-curveYLength;
tanLineInfo.controlCurve1X = point2.x+oppositeLength-curveXLength;
tanLineInfo.controlCurve1Y = point2.y+adjacentLength-curveYLength;
tanLineInfo.controlCurve2X = point2.x-oppositeLength-curveXLength;
tanLineInfo.controlCurve2Y = point2.y-adjacentLength-curveYLength;
} else if (lastPoint && angle<=0) {
tanLineInfo.curveXPoint = point2.x+curveXLength;
tanLineInfo.curveYPoint = point2.y+curveYLength;
tanLineInfo.controlCurve1X = point2.x-oppositeLength+curveXLength;
tanLineInfo.controlCurve1Y = point2.y-adjacentLength+curveYLength;
tanLineInfo.controlCurve2X = point2.x+oppositeLength+curveXLength;
tanLineInfo.controlCurve2Y = point2.y+adjacentLength+curveYLength;
}
return tanLineInfo; //return the Object with the info bound to it.
}
This snippet is just the function that returns all the dynamic drawing points by binding the variables to an object, and just returning that object. Like I said, this is still early on in the process, and I haven't actually classed things out yet, I just wanted to toss this out there and see if anyone with a better grasp of the Geom/Trig than I has any better ideas on how to tackle this.
Thanks in advance for looking!
Cleaning Up Code
Worked on this for a while, does the jpb, but because of the way I have done it, I can't get any removeMovieClip() functions to work on the new instances . . .
Need it cleaned up an in a way that I can use a removeMovieClip on it and have it actually remove them all.
Very Tired an need a new pair of eyes on this.
ActionScript Code:
/*********** Row One ***********/function row_one() { X = 400; Y = 340; scale = 100; for (i; i<3; i++) { duplicateMovieClip(_root.easy, "row_one"+i, i); setProperty ("row_one"+i, _x, X); setProperty ("row_one"+i, _y, Y); setProperty ("row_one"+i, _xscale, scale); setProperty ("row_one"+i, _yscale, scale); i++; X += 165; } }/*********** Row Two ***********/function row_two() { X = 205; Y = 410; scale = 125; for (ii; ii<3; ii++) { duplicateMovieClip(_root.easy, "row_two"+i, i); setProperty ("row_two"+i, _x, X); setProperty ("row_two"+i, _y, Y); setProperty ("row_two"+i, _xscale, scale); setProperty ("row_two"+i, _yscale, scale); i++; X += 195; } }/************* Row Three *************/function row_three() { X = 175; Y = 500; scale = 150; for (iii; iii<3; iii++) { duplicateMovieClip(_root.easy, "row_three"+i, i); setProperty ("row_three"+i, _x, X); setProperty ("row_three"+i, _y, Y); setProperty ("row_three"+i, _xscale, scale); setProperty ("row_three"+i, _yscale, scale); i++; X += 225; } }row_one();row_two();row_three();
I have almost the same code in three different frames, just using different instabnces as the basis for the duplication, and another layer that has a timer, when timer runs out, takes you to the scoreboard, now all was working well before i changed it to duplicate function, I just pulled them in from the library, but they weren't all the same size an crap (for perspective) But now ehn I get to the scoreboard, the darn things are still running.
Need to kill em off somehow.
Thanx in advance.
Cleaning The Stage?
Hello, everyone. I need some help. I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when i click a button, i would like the stage to be cleared, then another frame with another isometric code and another array to load.
The problem i am facing now is that the items positionned from the smiley are still on the stage if the next array is smaller than the previous one. Do you guys/gals know of any way i could clear the stage before going on the next frame? Currenlty, i tried unloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
trace(n);
n--;
unloadMovieNum(n);
if ( n<=0){
nextFrame();
} else { stop(); }
}
What happens is that it clears the stage, but doesnt load anything in teh following frame.
I hope that i was clear. If any confusion prevails, please answer the questions that linger in your minds.
Thank you in advance.
Cleaning Up Arrays
I was wondering how to check an array for a blank index and removing it.
Right now I have this:
ActionScript Code:
function cleanArray (it) { for (var i = 0; i < it.length; i++) { if (it [i] == undefined) { it.splice (i, 1); } } }
But it doesnt seem t work for me. What do you usually use?
Help Cleaning This Code
I'm relatively new to AS3 and learning. I would like to know how to reduce this code by maybe using arrays or loops? and still work the same. I'm using Tweener here. I pasted 2 of 6 buttons actions and if I wanted to make 6 or more buttons seems like alot of code?
import caurina.transitions.*;
but1.addEventListener(MouseEvent.ROLL_OVER, PopIn1);
but1.addEventListener(MouseEvent.ROLL_OUT, PopOut1);
function PopIn1(e:MouseEvent):void {
Tweener.addTween(glow1, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(step1, {scaleX:1, scaleY:1,delay:0.61,time:0.5,transition:"easeInOut Sine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0.5, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.7, transition:"easeInOutSine"});
lines.sublines.play()
step1.lines.sublines.play()
arrow1.gotoAndPlay(2);
}
function PopOut1(e:MouseEvent):void {
Tweener.addTween(step1, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
lines.sublines.stop()
step1.lines.sublines.stop()
}
but2.addEventListener(MouseEvent.ROLL_OVER, PopIn2);
but2.addEventListener(MouseEvent.ROLL_OUT, PopOut2);
function PopIn2(e:MouseEvent):void {
Tweener.addTween(text2, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(step2, {scaleX:1, scaleY:1,delay:0.5,time:0.5,transition:"easeInOutS ine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.65, transition:"easeInOutSine"});
arrow2.gotoAndPlay(2);
}
function PopOut2(e:MouseEvent):void {
Tweener.addTween(step2, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text2, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
}
Cleaning Up Listeners
this entire site's content is contained in a single fla (no external loading)
on my "load page" method, i add all the listeners needed for that "page"
i have an "unload page" method that removes these listeners, because it may cause problems and conflicts with new mouse events of other pages...
these listeners carry a decent amount of weight.
is it beneficial to performance or memory management to remove ALL listeners that aren't needed? or does this not matter?
if there was no benefit, then i would be able to add some listeners on init, and never have to remove, re-add them. this would make code more manageable.
Cleaning Up Code
Worked on this for a while, does the jpb, but because of the way I have done it, I can't get any removeMovieClip() functions to work on the new instances . . .
Need it cleaned up an in a way that I can use a removeMovieClip on it and have it actually remove them all.
Very Tired an need a new pair of eyes on this.
ActionScript Code:
/*********** Row One ***********/function row_one() { X = 400; Y = 340; scale = 100; for (i; i<3; i++) { duplicateMovieClip(_root.easy, "row_one"+i, i); setProperty ("row_one"+i, _x, X); setProperty ("row_one"+i, _y, Y); setProperty ("row_one"+i, _xscale, scale); setProperty ("row_one"+i, _yscale, scale); i++; X += 165; } }/*********** Row Two ***********/function row_two() { X = 205; Y = 410; scale = 125; for (ii; ii<3; ii++) { duplicateMovieClip(_root.easy, "row_two"+i, i); setProperty ("row_two"+i, _x, X); setProperty ("row_two"+i, _y, Y); setProperty ("row_two"+i, _xscale, scale); setProperty ("row_two"+i, _yscale, scale); i++; X += 195; } }/************* Row Three *************/function row_three() { X = 175; Y = 500; scale = 150; for (iii; iii<3; iii++) { duplicateMovieClip(_root.easy, "row_three"+i, i); setProperty ("row_three"+i, _x, X); setProperty ("row_three"+i, _y, Y); setProperty ("row_three"+i, _xscale, scale); setProperty ("row_three"+i, _yscale, scale); i++; X += 225; } }row_one();row_two();row_three();
I have almost the same code in three different frames, just using different instabnces as the basis for the duplication, and another layer that has a timer, when timer runs out, takes you to the scoreboard, now all was working well before i changed it to duplicate function, I just pulled them in from the library, but they weren't all the same size an crap (for perspective) But now ehn I get to the scoreboard, the darn things are still running.
Need to kill em off somehow.
Thanx in advance.
Cleaning The Stage?
Hello, everyone. I need some help. I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when i click a button, i would like the stage to be cleared, then another frame with another isometric code and another array to load.
The problem i am facing now is that the items positionned from the smiley are still on the stage if the next array is smaller than the previous one. Do you guys/gals know of any way i could clear the stage before going on the next frame? Currenlty, i tried unloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
trace(n);
n--;
unloadMovieNum(n);
if ( n<=0){
nextFrame();
} else { stop(); }
}
What happens is that it clears the stage, but doesnt load anything in teh following frame.
I hope that i was clear. If any confusion prevails, please answer the questions that linger in your minds.
Thank you in advance.
Cleaning Up The Actionscript?
Hello everyone,
I'm wondering if there is some type of command in flash, to be able to look thru the actionscript to find any code that refers to a movieclip that is no longer there.
Kind of like the auto indenting/error finder command in the AS window. But to just find actionscript that has no point (movie1._x = random()) - when "movie1" is no longer there
Please help
[AS] Help Cleaning My Code
Hey guys so i made a movieClip that is my button, on layer one, on layer 2 which is on top i made a blue box which is multiplied using flash 8 blend modes and its alpha is set to zero.
When you rollover it fades in using the tween and on rollout is fades out.
I wanted to keep in minimal moviclips so i added the same mc button 5 times to make a nav and i assigned button labels and i have each one use a different icon using the attachMovie.
The functions for rolover and rollout are set but what I need help in is cleaning up my code so its not so repetetive.
If u see below I am using the same stuff over and over. Please help.
Thanks In Advance,
Robert
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
//button Labels
this.company.btnLabel.text = "COMPANY OVERVIEW";
this.services.btnLabel.text = "SERVICES";
this.affiliates.btnLabel.text = "AFFILIATES & PARTNERS";
this.submit.btnLabel.text = "SUBMIT AN ACCOUNT";
this.contact.btnLabel.text = "CONTACT";
//button Icons
this.company.attachMovie("company_i", "company_mc", this.getNextHighestDepth(), {_x:20, _y:20});
this.services.attachMovie("services_i", "services_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.affiliates.attachMovie("affiliates_i", "affiliates_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.submit.attachMovie("submit_i", "submit_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.contact.attachMovie("contact_i", "contact_mc", this.getNextHighestDepth(), {_x:18, _y:20});
//
//buttons
this.company.onRollOver = function() {
roll(company.rollEffect);
};
this.company.onRollOut = function() {
roll_O(company.rollEffect);
};
this.services.onRollOver = function() {
roll(services.rollEffect);
};
this.services.onRollOut = function() {
roll_O(services.rollEffect);
};
this.affiliates.onRollOver = function() {
roll(affiliates.rollEffect);
};
this.affiliates.onRollOut = function() {
roll_O(affiliates.rollEffect);
};
this.submit.onRollOver = function() {
roll(submit.rollEffect);
};
this.submit.onRollOut = function() {
roll_O(submit.rollEffect);
};
this.contact.onRollOver = function() {
roll(contact.rollEffect);
};
this.contact.onRollOut = function() {
roll_O(contact.rollEffect);
};
//Button Effects
//RollOverFunction
function roll(btn_mc:MovieClip):Void {
new Tween(btn_mc, "_alpha", Strong.easeIn, 0, 100, 15, false);
}
//RollOutFunction
function roll_O(btn_mc:MovieClip):Void {
new Tween(btn_mc, "_alpha", Strong.easeIn, 100, 0, 30, false);
}
//
Cleaning Up Borders/edges
Been playing with some backgrounds and scenes trying to expand my animation library.
How do I clean up around the outer edges of my Flash art? For example, if my movie is 600x400, I'd like to have a nice rounded edge "movie" screen that is 595x395, and have all the "junk" that flowed over the edges to be deleted.
Sorry if this is a neophyte question, I'm not sure if I need to make a basic "background" bottom layer and delete around it, or what.
Thanks in advance.
tekchic
Cleaning Out Unused Symbols?
Hey... I have a whole slew of fla files that I built one on top of another - that is, creating one, then using it as the basis for the next....
Consequently, as time went by there are dozens of unused symbols in the libraries.... is there a quick and easy way to simply get rid of unused/unpublished symbols - just so I can clean these files up?
Any help would be most appreciated !
Cleaning Up Object Vars...
I've just done this tutorial:
http://jasonmerchant.com/tutorial.php?t=5
Basically, the code in the timeline is this:
Code:
var enemy1:enemy = new enemy();
stage.addChild(enemy1);
Which adds a new enemy. In the enemy.AS class, we have this:
Code:
public function die():void {
stage.removeChild(this);
}
When it's called, it removes the movieclip from the stage. Simple, right?
But my question is, what happens to our var, enemy1? Presumably this var is our entire copy of the object program, including the enemy's health and all its methods. Is there any way to destroy it? If we don't destroy it manually, will it reside in memory forever? Or will Garbage collection somehow take care of it? If so, when?
I want to spawn hundreds of enemies, perhaps 10 or so at a time, so it's vitally important that nothing "pile up" in memory as the game progresses, not even Numbers.
Thanks in advance for any helpful replies.
Cleaning An Arrey Before Populating It
If I have an array declared and then populated using push() method, and
then I need to re-populate it with smaller number of members, how shall I
clear it including its length setting to 0?
Cleaning Out Old CreateGradientBox Thingies?
Here's my question. I'm trying to create a rippling effect for use in a touch-sensitive kiosk -- when the user touches the screen, I want it to create a ripple effect (a sort of replacement for the mouse cursor).
I've created a gradientBox on a matrix, blah blah blah, and it appears as though the animation function I've thrown together works -- almost. I'm not sure how to erase the "old" gradientBoxes before the new one gets drawn.
Here's the code I'm using: Just copy it and save it and set it as the document class for a new movie to test.
I would greatly appreciate any help or direction! Thanks!
Code:
package
{
import flash.display.MovieClip;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.display.GradientType;
import flash.filters.DisplacementMapFilter;
import flash.filters.DisplacementMapFilterMode;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.events.*;
import flash.ui.Mouse;
public class DMFilterExample extends MovieClip
{
internal static var gbX:Number;
internal static var gbY:Number;
internal static var gbR:Number;
internal static var gbD:uint;
internal static var myMatrix:Matrix;
internal static var myBitmapData:BitmapData;
public function DMFilterExample ()
{
/**
* Base all of the circle's values on these numbers: including the
* gradientBox! The relationships here will kill the world if messed up!
*/
gbX=200;
gbY=200;
gbR=75;
gbD=0;
buildRippler(gbR*0.5);
this.stage.addEventListener(Event.ENTER_FRAME, animateRippler);
}
private function buildRippler (tmpGbR:Number):void
{
if (!tmpGbR) tmpGbR=gbR;
myMatrix=new Matrix();
myMatrix.createGradientBox(tmpGbR*2, tmpGbR*2, 0, gbX-tmpGbR, gbY-tmpGbR);
var colors:Array=[0xFF0000, 0xFF0000, 0xFF0000];
var alphas:Array=[0, 0.3, 0];
var ratios:Array=[0, 207, 255];
this.graphics.lineStyle(1, 0x000000, 0.3, false); // Debugging.
this.graphics.beginGradientFill(GradientType.RADIAL, colors, alphas, ratios, myMatrix);
this.graphics.drawCircle(gbX, gbY, tmpGbR);
if (myBitmapData) myBitmapData.dispose();
myBitmapData=new BitmapData(tmpGbR*2, tmpGbR*2, true, 0x000000)
myBitmapData.draw(this, myMatrix);
}
public function animateRippler (e:Event):void
{
gbD++;
gbD%=360;
buildRippler(Math.abs(((Math.PI/180)*Math.sin(gbD)*(gbR*0.75))*(gbR)));
}
}
}
FYI, once I get things working, this rippler won't be the document class...I'm just trying to take one step at a time...thanks!
Cleaning Class Resources And LoadMovie
Hi, I have a movieclip with two layers. One contains the preloader movieclip. Another one contains the content holder movieclip. I apply a dinamic effect to the loader layer to show/hide it (I have a graphic effect class -G Effect, that dinamically creates and attaches to it a complex mask with animation, and then destroys itself. Since this class uses setInterval, and attaches masks to the preloader movie, I have to clean up all the resources after it stops running or in the case it's called again while it's still running). It all works fine, the GEffect class is working fine, cleaning its resources, and starting "clean" every time... untill I use a loadMovie inside the content movieclip... After that the mask movieclip inside GEffect is not beeing destroyed anymore. I understand that loadMovie holds the reference to the content movieclip, so instances of classes inside that movieclip may not be detroyed... but I don't even apply my GEffect to that movieclip. I apply it to the preloader movieclip...
Anyone seen before any bugs when the class resources are not beeing cleaned up after loadMovie was called?...
Advice For Cleaning Up Nested For Loops...
Howdy,
I'm writing a ray tracer and I have a loop that looks like this
for(xpixels)
for(ypixels)
for(yjitter)
for(xjitter)
foreach(object in GeoPrimitives)
foreach(hit in hitList)
cast 4 random shadow samples
}
}
}
}
}
}
It works perfectly but It looks nasty, in my previous tests function calls were much more expensive in time that inline code, but does anyone have a suggestion how to clean this up? Thanks!
-Jon
Advise Needed About Scripting Cleaning Game :-)
Hi, I hope someone here can help me a bit:
I'm not really good with scripting, I'm more into
graphics and animation with flash, so I've made
some graphics, but now I don't known even where to
start with scripting..
What I wanna do is the following:
I want to make a game where objects appear random at
fixed positions in a room, the player must click
on the objects to remove them, (it's a cleaning game ).
but each time the player removes an object, the objects in the room
appear within a shorter time, if there are more then 8
objects in the room the game ends because the room is a mess,
so the game gets more difficult each time you remove a object.
How should I do this?
Thank you for looking..
btw. I use MX 2004
Best Approach: To Cleaning Up Duplicate Functions Across Classes?
Hey guys, whats the best way to clean up duplicate functions that are in several classes. I have the same function in like 4 classes and i dont know if i want to just remove it and put it in an external file, and just do an include line in all my classes.
what would be considered the best approach?
[AS3] Insight Needed, Specific Garbage Cleaning
Hi,
I won't post some code right now cause I don't really feel its needed. Anyway, I've been working with my A* pathfinder on and off for the past month (update from previous AS2 version) And while the pathfinder in itself is done, I introduced some new features to it recently, one being a queue system (Don't ask me how poor the thing was before..)
The thing with the queue system is that, when a path is added to be searched, it returns an ID, normally a uint, this is because, when the path calculation is done, it starts with the next path straight away (if there are any in the queue) so the path just completed would have to be saved somewhere, naturally its saved in an array.
Now what is the problem you ask? Cleaning this array, I mean, if it's not reset, it would eventually reach its limits. I know that's pretty unlikely unless I'll be continuously running path calculations for the next hour, But there's also the issue of loads of data stacking up, which would inevitably suck loads of memory.
Why is it hard to clean it? Ok so, since it keeps running calculations according to the queue, and it saves the paths in the array (due to the fact that it might not be retrieved straight away), so what if I happen to reset the array when a path has not been retrieved already? I mean, there could be way more than one path that has not been retrieved yet, if say, 40 paths were trashed instantly, it would call for 40 new paths in an instant, I'm not saying this could cause slowdowns, but rather delays, since it could take a few ms to calculate a new path.
The only solution I could think of right now is to implement a 'turn off' for the path calculating until the path array is empty (being able to clean it without losing anything). But, there is nothing that says the path even will be retrieved, so there could be small leftovers which will just sit there. I could also make a internal timer that will remove the paths if they have not been retrieved for a certain amount of time, which would eliminate the previous scenario.
I've also thought of an alternative to the array, which would be an object, using hash strings as keys to store the path data, and once retrieved just be removed. (There were some complications to doing this with an array, due to the fact that the IDs for paths were directly linked to the position in the array).
Bet that was loads of bull to read, any tips anyone?
Thanks for reading,
Matt
Cleaning Up A Flash 7 Code-doesn't Work With Flashplayer 8
Hi everyone, long time no see,
I have this old code that i can't use with flash player 8. I know it's a syntax error, but I can't figure out which one. I have two errors signaled, here is the code :
1 Pos = Number(Pos)+1;
2 if (Number(Pos)>Number(MsgLen)) {
3 gotoAndPlay(1);
4 }
5 duplicateMovieClip("LetterTemplate", "Letter" add Pos, Pos);
6 set("Letter" add Pos add "/:MyPos", Pos);
7 set("Letter" add Pos add "/Letter/:Char", substring(Message, Pos, 1));
8 setProperty("Letter" add Pos, _visible, Trus);
The error is on line 5, apparently i'm missing a ',' or a ')'.
AND i have another error :
removeMovieClip("../Letter" add MyPos);
and I'm still missing a ',' or a ')'.
Can anyone help? I'm not used yet to the new syntax...
And I bet it's pretty simple!!!
Thanks in advance...
Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.
I am have having the following error:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.
I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.
stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);
function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;
var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
status_txt.text = “Sending…”;
}
function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}
function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}
and the following asp.net code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"
Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")
'create the mail message
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)
'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody
'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)
Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)
Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>
String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?
Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:
Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Randomize String And Create Textfields With String Txts
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
Convert Multiline String To A One Line String With RegExp
better get my own thread for that
How can I convert a multiline String to a one line String?
EX:
PHP Code:
Testing is always full of man made bugs.
<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank">
<font color="#22229C">Believe</font>
</a>
me when times comes that you have to
<a href="http://www.vreate.com" target="_blank">create</a>
useless stuff to test some other useless stuff to have
<a href="http://www.vreate.com">some</a>
real results.. its a pain.
<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/>
<em>Got to try that stuff to eventually love it one day.</em>
and should result in
Code:
Testing is always full of man made bugs.<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank"> <font color="#22229C">Believe</font></a>me when times comes that you have to<a href="http://www.vreate.com" target="_blank">create</a>useless stuff to test some other useless stuff to have<a href="http://www.vreate.com">some</a>real results.. its a pain.<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/><em>Got to try that stuff to eventually love it one day.</em>
I think it have to play with the ^ (caret) and m (multiline) ... just need to put the puzzle together.
"cleaning Up" Drag And Drop
puzzled....
http://neumenex.com/e-archives/drag_test.fla
i am confused about a few things. i would like to be able to make the buttons become invisible (i have that) after being dropped and also, return to their starting location (this is what i need help with). also, i notice that unless you drop the button in a specific location, the target will not update. is there a way for me to make a larger area? when you test my movie you'll see that it takes about 90000 times to drop it in the "right spot". thanks for the help!
"cleaning Up" Drag And Drop
puzzled....
http://neumenex.com/e-archives/drag_test.fla
i am confused about a few things. i would like to be able to make the buttons become invisible (i have that) after being dropped and also, return to their starting location (this is what i need help with). also, i notice that unless you drop the button in a specific location, the target will not update. is there a way for me to make a larger area? when you test my movie you'll see that it takes about 90000 times to drop it in the "right spot". thanks for the help!
String.as (Fishing Line Or Kite String)
Hello everyone. After reading the article on Glen Rhodes (Proud Canadian) I was wondering exactly how to insert the string.as file. I have been having huuuuuuge speed issues with my code. My file sizes are quite small (40 - 60 k)but they are very sluggish.
Thank you......
Please help
http://www.moodvibe.com
Trouble With String.indexOf And String.lastIndexOf
Hi,
I have an input text field used for time. I'm trying to set it up so the user has to enter a valid time into the box.
I set the box to be only 5 characters in length and to only use numbers and the ":" character.
I thought this code would insure there wouldn't be two ":" characters and the ":" would be at lease one character from the begining and at least two from the end.
But the if you enter 2:321 it comes back as a valid time.
Thanks in advance,
thurston
Code:
if(string.indexOf(":", 1) == string.lastIndexOf(":", string.length-3) ){
trace("Valid Time");
}else{
trace("Invalid Time!!!");
}
Changing A String Name In A Loop / Concatonating String Name?
Hey all,
Does anybody know of a way to change a string name as a loop proceeds?
This is the main piece of code that I wish to loop with i incrementing, so that whilst i=0 then:
_root.barARed._visible=barRed[i];
_root.barARed._width=barLength[i];
_root.barAYellow._visible=barYellow[i];
_root.barAYellow._width=barLength[i];
_root.barAGreen._visible=barGreen[i];
_root.barAGreen._width=barLength[i];
infoA.text=info[i];
and i=2 then:
_root.barBRed._visible=barRed[i];
_root.barBRed._width=barLength[i];
_root.barBYellow._visible=barYellow[i];
_root.barBYellow._width=barLength[i];
_root.barBGreen._visible=barGreen[i];
_root.barBGreen._width=barLength[i];
infoB.text=info[i];
and so on...I would use _root.barRedInstanceName[i]._visible=barRed[i]; but I can't give the movie clip (the bar) an instance name such as redBar[1], redBar[2] etc. (system reserved I'm told)
I guess what I am trying to ask in a roundabout way: is how do you concatonate the name, rather than the contents of a string?
Hope you'll forgive me if this is something really simple that I am overlooking, but I only have a very short experience of flash.
Thanks
Al
|