Loading A LoadVars Multiple Times
So i'm making a calender thingy. i have a php file get_events.php that gives me the events for that date
i have two loadVars objects. when dataVars loads, i just trace what's in it.
Code:
var sendVars = new LoadVars();
var dataVars = new LoadVars();
dataVars.onLoad = function(){
for(i in dataVars){
trace(dataVars[i]);
}
}
so for the sendVars, i have the user put in a date, and then i send the send vars.
Code:
sendVars.date = *user inputed date*;
sendVars.sendAndLoad("get_events.php", dataVars, "POST");
so the problem i'm having is that if the previous call to sendAndLoad received more events than the current one, dataVars still has those events at the end of the array. do i need to clear dataVars or something each time?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 10-30-2006, 06:51 PM
View Complete Forum Thread with Replies
Sponsored Links:
Loading The Sam Jpg Multiple Times
Hi There,
I have a flash movie where I load the same external jpg multiple times... When I look in the activities window in my browser I see that the .jpg is loaded multiple times, instead of using the cached version of the .jpg.
So instead of using 30kb on data traffic, it uses 3x30kb on data traffic...
Does anyone know a solution for this. I tried loading the jpg in an mc and then duplicating this... but unfortunattly this doesn't work...
Tnx in advance,
Skem
View Replies !
View Related
Loading An Image Multiple Times
Hi, guys:
I'm programming a puzzle game for a client that will load an image randomly from a series of image URLs stored in a database.
This image will be loaded into the swf using "loadMovie". The problem is that even though al the pieces of the puzzle use the same image, I find no way to load the image just once!. It seems every piece has to load the image all over again. This wouldn't be sucha big deal if the image loaded from the first piece could be read from the cache, but to my surprise, every piece loads the same image from the net!
I tried loading a first image into a movie clip acting as a placeholder, and then duplicating that movieclip, but to no use: the duplicate movie clip does not carry the loaded image.
Is there anything to do to avoid loading the image multiple times, apart from slicing it?
Thanks a million.
JADC
View Replies !
View Related
Loading The Same Image Multiple Times
Hi guys,
I'm working on a project where I'd like to get a list of images via xml, and buttons will display each different image when you roll over them. I've got it working, each with their own preloader, but I was wondering if there was any way to keep from loading the same image over and over after the first time. The issue (not that big a deal, just trying to avoid it if I can) is that when I rollover a button, the preloader pops up for a split second before the image takes its place. If the image has been loaded before, I'd rather not have that happen. Is there a way around that? Or is it the case that if I destroy the movie clip that the image is being loaded into, you have to load the image back up from scratch again? Is there any way to load images into, like... a compile time library or something?
View Replies !
View Related
Sound Object Loading Multiple Times..only Want 1
Hello all, sometimes (about 1 out of 6 times) the mp3 I'm trying to load dynamically seems to load twice when my audioplayer .swf loads in-page, which produces an echo delay effect . This also renders the audio controls useless (it only seems to stop one of the loaded tracks).
I suppose maybe I could eliminate this problem if creating a movieclip from scratch but I suppose that's another tutorial....
I'm loading the sound "_root.myContainer.myMusic" into a clip offstage "_root.myContainer".
Any AS that can make sure only one instance of the mp3 is loaded into the clip? Here's a link to the page: Link
I'm not at home right now but will post the exact actionscript or the .fla if necessary when I get home.
Thanks
View Replies !
View Related
Loading Multiple Txt Files W/ One LoadVars Object?
Basically, my question is: is it possible to load multiple files using only one loadVars object? Here's what i've got
Code:
_root.data_list = new LoadVars();
_root.data_list.load("city_usa.txt");
_root.data_list.load("state_usa.txt");
_root.data_list.onLoad = function(success) {
data_string = _root.data_list.toString();
//split the string into an array
_root.data_array = data_string.split("%0D%0A");
type = _root.data_array.shift();
//get the subdivisions of the list
_root.data_subsets = _root.find_subdivisions(data_array, n_divisions);
listString = _root.data_subsets.join("
");
if(type == "city") {
_root.cityListMC.textBox.text = listString;
}
else if(type == "street") {
_root.streetListMC.streetListBox.text = listString;
}
};
what ends up happening is that my cities display correctly, but when it goes through and does states, the cities are appended to the end of the string data_list. is there any way to clear the loadVars object between loads or do i need to make a different loadVars for each txt file? i've also got to do streets, countries, etc, so i'd prefer to have only one object and one onLoad method.
thanks
em
View Replies !
View Related
LoadVars() - Loading Multiple Items Within One Movie.
What would be considered the best way to load multiple text fields in a flash movie?
For example, I have 5 input text fields with variable names in flash of text1, text2, text3, text4, text5. The instance names for each field is txt1, txt2, txt3, txt4, txt5.
I'm using the LoadVars() class to do this. I know how to load one of these variables into the input text field I just don't know how to do all 5 of them at the same time? Am I going to have to make 5 seperate LoadVars() Objects and load them like that?
Thanks for any help!
View Replies !
View Related
LoadVars - Text File Loading Multiple Entries
Hi there,
I've been looking for a solution to my prob on the forums but none are quite right. i'm trying to load multiple entries from a text file one after the other into a text box using the LoadVars() command.
This script below currently loads the last entry from the text file - i'm falling down with the looping script. My text file structure is this:
content=start&
id=1&title=Entry one&body=Body Text Updated Test test&date=8/14/06 12:00 AM&
id=2&title=test of new story&body=This is a bit of a new story&date=9/1/06 4:38 PM&
content=end&
i'm unsure if i need to make an array and use the 'id' parameter to identify the entry. I'd really appreciate some help. Thanks
Heres my script:
myData = new LoadVars();
// define callback for onLoad event
myData.onLoad = function(success) {
if (success) {
date = this.date;
title = this.title;
body = this.body;
id = this.id;
//populate text field
myBody_txt.htmlText = date+"<br>"+title+"<br>"+body+"<br>"+id;
} else {
// what to do in case of data error
myBody_txt.htmlText = "<b>Error loading Data</b>";
}
};
// now load the text file
myData.load("myText.txt");
stop();
View Replies !
View Related
LoadVars - Text File Loading Multiple Entries
Hi there,
I've been looking for a solution to my prob on the forums but none are quite right. i'm trying to load multiple entries from a text file one after the other into a text box using the LoadVars() command.
This script below currently loads the last entry from the text file - i'm falling down with the looping script. My text file structure is this:
content=start&
id=1&title=Entry one&body=Body Text Updated Test test&date=8/14/06 12:00 AM&
id=2&title=test of new story&body=This is a bit of a new story&date=9/1/06 4:38 PM&
content=end&
i'm unsure if i need to make an array and use the 'id' parameter to identify the entry. I'd really appreciate some help. Thanks
Heres my script:
myData = new LoadVars();
// define callback for onLoad event
myData.onLoad = function(success) {
if (success) {
date = this.date;
title = this.title;
body = this.body;
id = this.id;
//populate text field
myBody_txt.htmlText = date+"<br>"+title+"<br>"+body+"<br>"+id;
} else {
// what to do in case of data error
myBody_txt.htmlText = "<b>Error loading Data</b>";
}
};
// now load the text file
myData.load("myText.txt");
stop();
View Replies !
View Related
One Sound. Multiple Times
Hi,
Probably really simple, but I cant seem to find an answer to this. I have one sound and in the intro to my website the buttons appear on screen one at a time. As they each appear on screen I want a short sound/beep to play. Im sure I can use action script to call on the sound from the Library rather that enter the sound 8 times into the time line.
Please can someone help me answer this query,
Cheers!
Wazz
View Replies !
View Related
Load A .jpg Multiple Times
Heylo!
I'm currently working on a webshop in flash and i ran into the following problem.
I want to display all the product with their images on a page. On the same page i want a small list with 'popular purchases'. Generating the products is no problem. When i want to generate the popular purchases list, the pictures wont show. I think its got something to do with the fact that flash already loaded the pictures for the product list. Anyone got an idea to fix this? Thanks!
View Replies !
View Related
Looping Multiple Times
Hi I'm trying to figure out how to display a message after 2 atempts from the user. Its an elementary math quiz. If the user gets the answer incorrect after 2tries I want to display a message telling to to "Practice with their flash cards". So I guess I would want to loop twice to allow the user to enter their answer and check it.
Here is what I tried...
Code:
mx.accessibility.AlertAccImpl.enableAccessibility();
import mx.controls.Alert;
var myEquations:Array = [];
var myOperators:Array = ["+","-","*","/"];
for (var i:Number = 0;i < 10;i++) {
var num1:Number = Math.round((Math.random() * 10) + 1);
var num2:Number = Math.round((Math.random() * 10) + 1);
var randOp:Number = Math.round(Math.random() * (myOperators.length - 1));
var temp:String = num1.toString() + " " + myOperators[randOp] + " " + num2.toString();
//trace("this is random string " + i + ": " + temp);
myEquations.push(temp);
}
//first, I'll set up a variable to hold
//the current equation we're on.
var currentEq:Number = 0;
//now here's a function that will place
//the equation in the left textfield.
var setEquation:Function = function() {
eq_txt.text = myEquations[currentEq];
}
//And, now that our equations are all inside the
//myEquations array, let's see how
//we can compute them:
var checkFunction:Function = function() {
var ta:Array = myEquations[currentEq].split(" ");
//trace("here's ta: " + ta);
var tmp:Number;
switch(ta[1]) {
case "+" :
//trace("we're adding");
tmp = parseInt(ta[0]) + parseInt(ta[2]);
break;
case "-" :
//trace("we're subtracting");
tmp = parseInt(ta[0]) - parseInt(ta[2]);
break;
case "*" :
//trace("we're multiplying");
tmp = parseInt(ta[0]) * parseInt(ta[2]);
break;
case "/" :
//trace("we're dividing");
tmp = parseInt(ta[0]) / parseInt(ta[2]);
break;
}
//trace("and tmp is: " + tmp);
if (tmp.toString() == ans_txt.text) {
//trace("correct!");
Alert.show("Yes, You are Correct!");
ans_txt.text = "";
currentEq ++;
setEquation();
} else {
Alert.show("What are you doing?");
Selection.setFocus(ans_txt.text);
//trace("wrong!");
}
}
//If answer is wrong 2 times display message
for (var i:Number = 0;i < 2;i++) {
if (tmp.toString() == ans_txt.text) {
//trace("correct!");
ans_txt.text = "";
currentEq ++;
setEquation();
} else {
Alert.show("Please Practice with your flash Cards");
Selection.setFocus(ans_txt.text);:help:
}
}
setEquation();
check_mc.onRelease = checkFunction
View Replies !
View Related
Using Button Multiple Times Bug
Hi,
I am currently working on a project using CS3. I firstly created a button symbol and customised it to use repeatedly. I added event listeners and created the functions but for some reason when I drag and drop a new instance of that button from the library onto the stage, even with not instance name it uses the event off a previous button.
I tried duplicating the button in the library and that worked. But it still doesn't answer why the original button didn't.
Here is the code to the the button which keeps being copied.
ActionScript Code:
registerBtn.addEventListener(MouseEvent.CLICK, registerPage)
// Direct to Register Page
function registerPage(e:MouseEvent) {
// Go to Register page. (Frame Label: "Register")
gotoAndStop("Register");
}
So now when I drag and drop the button from the library it executes the 'registerPage' function without even being defined.
Maybe I need to reinstall my version of Flash CS3?
This used to work when I worked with Macromedia Flash 8
I hope one of you Flash veterans can figure it out
Cheers,
Ziyad
View Replies !
View Related
Multiple Tweens At Different Times Using AS...
OK, so I've searched and searched, but I can't seem to find something that's helping me achieve my goal...
What I want is to do this http://www.laughwithlarry.com/ in actionscript rather than with tweens...as u can see, it takes EONS too long to load (on some PCs at least) (and I know, it DOES need a preloader (which I have), but I'm going to add that later. I want to get this going first).
Now, I read a decent bit about onEnterFrame, and did some tutes, but I'm not quite sure how to use it to do what I want...can any1 out there give me some direction/guidence?
Thanks much!
View Replies !
View Related
Use Mask More Multiple Times?
Hey all:
I want to use a single (somewhat complex) mask on 2 movie clips, but, using a simple example, I've discovered that only the final setMask for a given mask is used. ie.Code:
square.setMask(circleMask);
square3.setMask(circleMask);
// only square3 gets masked
Am I doing something wrong? Is there a simple fix besides createing a new instance of the mask each time its used?
Thanks.
Mitch
View Replies !
View Related
What Do I Change In This Script So I Can Use It Multiple Times
heres the code
startx = GetProperty(/:menu,_x) ;
starty = GetProperty(/:menu,_y) ;
horizontalno = /:targetx-startx;
vertikalno = /:targety-starty;
setProperty(/:menu, _x, startx+(horizontalno/2));
setProperty(/:menu, _y, starty+(vertikalno/2));
i use this on the main timeline to controll a mc, then inside the mc i want to use it again, to controll a smaller mc nested inside.
but the code wont work on the second one... i would change "menu" to a different mc name but it still wouldnt work.
can anyone help?
View Replies !
View Related
Key Object Executes Multiple Times. Help?
Ok, so in my main timeline I have three MCs. 1 at frame 10. 1 at frame 20. And 1 at frame 30.
In each MC I have a Key Object:
keycatcher = new Object();
keycatcher.onKeyDown = function () {
if Key.DOWN...call function...yadda
}
Key.addListener(keycatcher);
Now, the first time I go to frame 10, 20 or 30 it all works fine.
But, after going back and forth between say 10 and 20, the keycatcher object calls the function multiple times for each down key!?!?
If I go 10 to 20 to 10, it executes twice each. If I go from 10 to 20 to 10 to 20 to 10 it executes four times each. And just increments from there. Every time I go back and forth it doubles.
I even tried to kill the object at the first frame of all the MCs via
Key.removeListener(keycatcher) but it didnt help.
I know I should have just had the one key object in root and passed the appropriate vars to it. But, you know what they say about hindsight...
Any ideas?
TIA
Ahhhk!
Let me just clarify, the function is being called multiple times because the "if Key.DOWN" is triggering multiple times and calling the function for each.
View Replies !
View Related
Can't Trigger Button Multiple Times....odd.
Ok, so I have this spiffy lil button. In the instance, I have a:
on (release) {
_root.someFunction();
}
I also tried on (press).
Now, clicking the button works fine the first time - it calls the function. But, if I click the button a second time (w/o moving the cursor off the button), the function isnt called.
Waiting even a minute between clicks doesnt change anything.
However, if I move the cursor off the button/hit area, then move it back and click it again, it works fine. I can do this really fast and it triggers everytime so its not a timing/function return issue.
So, what am I missing? This is a standard (non-dynamic) button with simple Up/Over/Down/Hit blocks.
TIA!
Ahhhk!
View Replies !
View Related
Calling A Function Multiple Times
Any ideas on the best way to fade a number of different movie clips simultaneously.
I'm using a for...loop to address each mc, that calls a fade function ( using onEnterFrame to reduce the alpha by 10 each pass )- but the function is only working on the last mc to be called.
For example i=1 to 10 addresses each mc and then calls the function for each one. The function is only working on mc number 10, as it seems to restart with each new mc. Can I pause the for...loop until the function has finished ????
View Replies !
View Related
Rotating Circle Multiple Times
So I have searched for an answer and have yet to come up for one on these forums. My goal is to rotate a circle which is behind another circle. I have the following actionscript which allows this but my problem is I don't want the circle to move initially when the user presses it. I want it only to move when the user is rotating the circle.
Here's the action script
myDial.onPress = function() {
pressing = true;
};
myDial.onRelease = myDial.onReleaseOutside=function () {
pressing = false;
};
_root.onEnterFrame = function() {
if (pressing == true) {
myRadians = Math.atan2((_ymouse-myDial._y), (_xmouse-myDial._x));
myDegress = Math.round(myRadians*180/Math.PI);
_root.myDial._rotation = myDegress+90;
}
};
What this does is aligns the circle at a point with the users mouse and then rotates the circle. What I want is to not have the circle move initially until the user moves it.
Also is there an easy way to define a numerical variable to the amount the user has rotated? i.e. for every full rotation a value of 30 and vica-versa for clockvise rotation
Cheers
Blair
View Replies !
View Related
Loader Occurring Multiple Times
Code:
one_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
two_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
three_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
four_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
var container_mc:MovieClip = new MovieClip();
container_mc.x = 0;
container_mc.y = 0;
addChild(container_mc);
MovieClip(loadbar).alpha = 0;
MovieClip(stroke_mc).alpha = 0;
function buttonAction(e:MouseEvent):void {
MovieClip(loadbar).alpha = 100;
MovieClip(stroke_mc).alpha = 100;
var t:String = String(e.target.name);
var a:Array = String(t).split("_");
var the_url:URLRequest = new URLRequest();
the_url.url = "images/" + a[0] + ".jpg";
var the_loader:Loader = new Loader();
the_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoaderProgress);
the_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
while (container_mc.numChildren > 0) {
container_mc.removeChildAt(0);
}
the_loader.load(the_url);
}
function onLoaderProgress(e:Event):void {
MovieClip(loadbar).scaleX = e.target.bytesLoaded / e.target.bytesTotal
}
function onLoaderComplete(e:Event):void {
container_mc.addChild(e.target.content);
e.target.addEventListener(ProgressEvent.PROGRESS, onLoaderProgress);
e.target.addEventListener(Event.COMPLETE, onLoaderComplete);
MovieClip(loadbar).alpha = 0;
MovieClip(stroke_mc).alpha = 0;
}
Whenever I load something, if I click a second button while one of the others is in the process of loading the previous one continues to load. So if I clicked button 1 then clicked button 2 while button 1's content was still loading, the content for button 1 still loads and when its finished it shows.
How do I remedy this? In AS2 a container would only hold one external clip at a time, but that is no longer the case and I'm kind of at a loss here.
Thanks.
View Replies !
View Related
Can I Make Multiple Clock Times?
I have trouble cause I have to make recovery of some world time flash file where it shows different time zones : Sofia, New York, Japan, and London...
so the code that the previous person has made is:
function UpdateClock () {
myDate = new Date ();
hours = Number(myDate.getHours());
minutes = Number(myDate.getMinutes());
seconds = Number(myDate.getSeconds());
if(minutes<10){ minutes="0"+minutes; }
paris=hours-1;
london=hours-2;
newYork=hours-7;
Tokyo=hours-5;
}
Here from Bulgaria it works perfect.
But in this way when you open the file from abroad it calculates the bulgarian time for local and this is not right as I know... what can I do so it to show the time accurate everywhere in the world. Do you know some tutorials for world times made in Flash so I to see how they have done it?
View Replies !
View Related
Referencing A Function Multiple Times
I have this code to make mc's move and scale
Code:
function startMove(x, y, w, h) {
this.destX = x;
this.destY = y;
this.destW = w;
this.destH = h;
this.onEnterFrame = move;
}
function move() {
this._x += (this.destX-this._x)/4;
this._y += (this.destY-this._y)/4;
this._width += (this.destW-this._width)/4;
this._height += (this.destH-this._height)/4;
if (Math.round(this._x) == this.destX && Math.round(this._y) == this.destY) {
if (Math.round(this._width) == this.destW && Math.round(this._height) == this.destH) {
this._x = this.destX;
this._y = this.destY;
this._width = this.destW;
this._height = this.destH;
delete this.onEnterFrame;
}
}
}
What is the proper way to set up multiple calls of this code?
Currently I am doing this
Code:
btn.onRelease = function(){
startMove.call(mcBox, 176, 16, 208, 108)
startMove.call(mcText, 180, 150, 193.9, 32.7)
startMove.call(compFader, 180, 20, 200, 100)
startMove.call(mcMask, 190, 30, 190, 90)
}
Is there anyway to reference the startMove.call and then add all of my parameters under it somehow?
Thanks
View Replies !
View Related
Calling Same Function Multiple Times
I am trying to make a simple text effect I can easily modify and use across a flash project. I have a function that does the effect just the way I want it, until I try to call the function somewhere else in the movie. I was hoping someone could lend a hand.
Code:
function superText(theText,space,initX,initY){
i=1;
speed = 50;
function newText() {
if(i<theText.length+1) {
thisLetter = theText.substring(i-1,i);
textMovies = attachMovie("textBox","textBox"+i,i);
textMovies._x = textMovies._x + initX
textMovies._x = textMovies._x + initX +(space * i);
textMovies._y = initY;
textMovies.theText = thisLetter;
++i;
} else {
clearInterval(intevalID);
}
}
intevalID = setInterval(newText,speed);
}
superText("Am I Qualified?",12,4,50);
So far I can get the last function call to run normally. I have tried making all variables dynamic and had some even stranger results.
View Replies !
View Related
Sound Plays Multiple Times
I'm doing a site where I have attached a soundtrack to the first frame.
secondSound = new Sound();
secondSound.attachSound("SoundTrack7");
firstSound.start(0,999);
I have clips for buttons set up so that when you click the button it will send you to a different section of the website that is set up on frame 2. The music is still playing..
Now when you go back to frame 1, I have 2 of the same soundtrack playing on top of each other....what can I put in the actionscript to check and see if the soundtrack is already playing so I can prevent this.
Thanks
View Replies !
View Related
Clicking Movieclip Multiple Times
I have a Flash file made to look like a monitor in which the user can click a button to toggle through settings on the monitor (as you would if you wanted to change the brightness or contrast on your monitor). I want to enable the user to click on the up or down arrow movieclip multiple times to increment/decrement a value on the screen. However, after you click once, it seems to me that you have to move the mouse (even just a millimeter) in order for the next click to take effect. Is this a Flash issue, or is there some way I can get around this so the user can keep the mouse steady and still click the mc multiple times?
Chris
View Replies !
View Related
Attaching A Movie Multiple Times
I'm a little stuck on how to attach a movie using a for loop. I eventually would like to pull data from a database, put it in an array, then using a for loop attach a radio button component. For now, I'm just trying to work on attaching the movie using data from a hard-coded array.
Right now only one radio button appears without a label. What am I doing wrong.
myData =["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
for(var i=0; i<myData.length; i++)
mcName = "myList" + i;
this.attachMovie("FRadioButtonSymbol", mcName, 1, {_x:100, _y:100});
mcName.setLabel(myData[i]);
mcName.setChangeHandler("show");
function show(obj){
var selected = obj.getSelectedItem().label
trace(selected)
//Your code to use the selected value
}
View Replies !
View Related
Play Animation Multiple Times
Hello to everyone,
I have a flash banner animation and I need to know if there is any sort of script that plays the animation multiple times all over from the beginning and then stop at the end (let's say after playing three times it then stops.
I have already found a solution about my above request, but just need if anyone has the script for it.
I am good at flash and can help someone in return if needed anything, but this type of requirement that I am asking above is something I have never done.
Thanks for all your kindness and help.
Respectfully yours,
Beko
View Replies !
View Related
Using OnPress Multiple Times On Different Frames
Hi,
I have a menu file (cs3) for navigation on a web site. It's pretty basic, as I am new to using flash extensively. I always try to do it all with JS.
There is a list of 5 "sections" (buttons), and when one is clicked a sub-menu fades in beside it. These new buttons, however, do not work. All buttons use a onPress function . I have studied this some and read something about parent and child movieclips, but there aren't any mc's in my file. Not sure if this can apply to buttons as well...
Basically, I just need the second sets of buttons to work. I will attach code for them. The AS is in a separate keyframe from all of the buttons but on the same timeline frame number. All links are opened within an iframe on the same page.
Any help would be appreciated!
Attach Code
l_meetourteam.onPress = function(){
getURL("meet_our_team.asp", "frame");
}
View Replies !
View Related
Loader Occurring Multiple Times
Code:
one_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
two_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
three_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
four_btn.addEventListener(MouseEvent.MOUSE_UP, buttonAction);
var container_mc:MovieClip = new MovieClip();
container_mc.x = 0;
container_mc.y = 0;
addChild(container_mc);
MovieClip(loadbar).alpha = 0;
MovieClip(stroke_mc).alpha = 0;
function buttonAction(e:MouseEvent):void {
MovieClip(loadbar).alpha = 100;
MovieClip(stroke_mc).alpha = 100;
var t:String = String(e.target.name);
var a:Array = String(t).split("_");
var the_url:URLRequest = new URLRequest();
the_url.url = "images/" + a[0] + ".jpg";
var the_loader:Loader = new Loader();
the_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoaderProgress);
the_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
while (container_mc.numChildren > 0) {
container_mc.removeChildAt(0);
}
the_loader.load(the_url);
}
function onLoaderProgress(e:Event):void {
MovieClip(loadbar).scaleX = e.target.bytesLoaded / e.target.bytesTotal
}
function onLoaderComplete(e:Event):void {
container_mc.addChild(e.target.content);
e.target.addEventListener(ProgressEvent.PROGRESS, onLoaderProgress);
e.target.addEventListener(Event.COMPLETE, onLoaderComplete);
MovieClip(loadbar).alpha = 0;
MovieClip(stroke_mc).alpha = 0;
}
Whenever I load something, if I click a second button while one of the others is in the process of loading the previous one continues to load. So if I clicked button 1 then clicked button 2 while button 1's content was still loading, the content for button 1 still loads and when its finished it shows.
How do I remedy this? In AS2 a container would only hold one external clip at a time, but that is no longer the case and I'm kind of at a loss here.
Thanks.
View Replies !
View Related
Running A Function Multiple Times
I have posted this question in several different ways and looked all over, but I still don"t know...
I have a function that creates an object(I've run into this problem while creating movieclips and sounds) I only want one of this object to exist. So when the function is called again I want it to remove the previous object. Does that make sense, I don;t know if this is a coding question or if I need to understand something about how the compiler works or what, but any advise or links would be appreciated.
View Replies !
View Related
AS3 - Accessing Classes Multiple Times
Hi all,
I have create an AlignMC class that takes 2 parameters; MovieClip, alingType as String..
now when i call it i use:
Code:
var alg:AlignMC = new AlignMC(mcHolder, "AM");
so lets say i wanted to access the same class a few times in one function.. do i have to create another var as AlignMC or is there a better way to do it?
Any ideas? Thanks !
View Replies !
View Related
Using Multiple Instances Of LoadVars For Multiple Forms
Hi,
I've got a microsite with an Enter to Win contest page. On that first page, I ask for the user's name and e-mail. This enters them to win.
Once they've done so, they have the option to tell a friend, where I ask for the user's name, e-mail, friend's name, and friend's email. It will then use this information to send an email to the friend from the user, using asp. This code occurs on the next frame of the file.
Once they've told a friend, it goes to the next frame, which is just another tell-a-friend page, but with different text. There is a 4th frame which simply says "Entry Failed" if this process does not work.
I'm having problems getting past the first page. I've gotten this code to work before, so I'm wondering if it's because I'm using so many instances of LoadVars... I tried changing the variables associated with each page, but that didn't work. Anybody have ideas on how to successfully get through these pages?
Here's the first page:
ActionScript Code:
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
function f1() {
cbox.setLabel("Checked");
}
submit_btn.onRelease = function() {
status_txt.text = "";
if ((yname.text.length>1) && (yemail.text.length>1)) {
senderLoad.yname = yname.text;
senderLoad.yemail = yemail.text;
senderLoad.femail = "initial";
if (cbox.selected == true) {
senderLoad.newsletter = "Yes";
} else {
senderLoad.newsletter = "No";
}
senderLoad.sendAndLoad("form.asp",receiveLoad,"POST");
} else {
status_txt.text = "Fill out the form completely";
}
};
receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndStop(2);
} else {
gotoAndStop(4);
}
trace(this.sentOk);
};
clear_btn.onRelease = function() {
yname.text = "";
yemail.text = "";
};
privacy_btn.onRelease = function() {
getURL("http://www.hmns.org/privacy_statement.asp?r=1", _blank);
};
rules_btn.onRelease = function() {
getURL("dino_contest_rules.pdf", _blank);
};
The second page:
ActionScript Code:
stop();
var sendLoad:LoadVars = new LoadVars();
var recLoad:LoadVars = new LoadVars();
friend_btn.onRelease = function() {
trace("you've hit the dag hum button!");
//getURL("javascript:openNewWindow('friend.html','thewin', 'height=300,width=700,toolbar=no,scrollbars=no')");
status_txt.text = "";
if ((yname.text.length>1) && (yemail.text.length>1) && (fname.text.length>1) && (femail.text.length>1)) {
sendLoad.yname = yname.text;
sendLoad.yemail = yemail.text;
sendLoad.fname = fname.text;
sendLoad.femail = femail.text;
sendLoad.sendAndLoad("form.asp",recLoad,"POST");
} else {
status_txt.text = "Fill out the form completely";
}
};
recLoad.onLoad = function() {
if (this.sentOk) {
gotoAndStop(3);
} else {
gotoAndStop(4);
}
trace(this.sentOk);
};
The third page page looks just like the second, but with different loadVars variables.
And the form.asp code:
Code:
<%@ LANGUAGE="VBScript" %>
<%
dim fs,f, namefill, notefill, body,your_name,your_email,friend_name,friend_email,newsletter,datetime
referers = Array("dinomummycsi.internal.hmns.org", "dinomummycsi.hmns.org")
smtpServer = "mail.hmns.org"
fromAddr = "webmaster@hmns.org"
subject = "“Unearth Your Own Dinosaur Mummy” giveaway!"
Response.Buffer = true
errorMsgs = Array()
'Check for form data.
if Request.ServerVariables("Content_Length") = 0 then
call AddErrorMsg("No form data submitted.")
end if
'Check if referer is allowed.
validReferer = false
referer = GetHost(Request.ServerVariables("HTTP_REFERER"))
for each host in referers
if host = referer then
validReferer = true
end if
next
if not validReferer then
call AddErrorMsg("Invalid referer: '" & referer & "'.")
end if
'get the post fields
your_name = Request.Form("yname")
your_email = Request.Form("yemail")
newsletter = Request.Form("newsletter")
friend_name = Request.Form("fname")
friend_email = Request.Form("femail")
'Check for the recipients field.
if your_email = "" then
call AddErrorMsg("Missing email recipient.")
elseif not IsValidEmail(your_email) then
call AddErrorMsg("Invalid email address: " & your_email & ".")
end if
if friend_email <> "initial" then
if friend_email = "" then
call AddErrorMsg("Missing Friend Email.")
elseif not IsValidEmail(friend_email) then
call AddErrorMsg("Invalid friend email address: " & friend_email & ".")
elseif friend_email = your_email then
call AddErrorMsg("You can't tell yourself!")
end if
end if
'If there were no errors, build the email note and send it.
if UBound(errorMsgs) < 0 then
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile("N:Webleocontest.txt", 8, true)
f.WriteLine """" & your_email & """,""" & your_name & """,""" & newsletter & """,""" & now() & """"
f.Close
set f=Nothing
set fs=Nothing
'We do the tell a friend processing here
if friend_email <> "initial" then
if (trim(your_name) <> "") then
namefill = ", " & your_name & ","
end if
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("efriend.html"))
body = f.readall
f.Close
set f=Nothing
set fs=Nothing
body=replace(body,"%%NAME%%",namefill)
recipients = friend_email
str=SendMail()
end if
Response.Write "sentOk=True"
Response.End
end if %>
<html>
<head>
<title>Form Mail</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="body" align="center">
<div id="group">
<center>
<% if UBound(errorMsgs) >= 0 then %>
<table border=0><tr><td><font color="#cc0000" face="Arial,Helvetica" size=4><b>
Form could not be processed due to the following errors:</b></font><br>
<ul>
<% for each msg in errorMsgs %>
<li><font color="#cc0000" face="Arial,Helvetica" size=4><% = msg %></font>
<% next %>
</td></tr></table>
<% end if %>
<%=notefill%><br>
<%=namefill%><br><br>
<%=body%><br>
<font color="#cc0000" face="Arial,Helvetica" size=4><br><b><a href="#" onClick="history.go(-1)">Back</a></b></font>
</center>
</div>
</div>
</body>
</html>
<% '---------------------------------------------------------------------------
' Subroutines and functions.
'---------------------------------------------------------------------------
sub AddErrorMsg(msg)
dim n
'Add an error message to the list.
n = UBound(errorMsgs)
Redim Preserve errorMsgs(n + 1)
errorMsgs(n + 1) = msg
end sub
function GetHost(url)
Dim i, s
GetHost = ""
'Strip down to host or IP address and port number, if any.
if Left(url, 7) = "http://" then
s = Mid(url, 8)
elseif Left(url, 8) = "https://" then
s = Mid(url, 9)
end if
i = InStr(s, "/")
if i > 1 then
s = Mid(s, 1, i - 1)
end if
getHost = s
end function
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
function FormFieldList()
dim str, i, name
'Build an array of form field names ordered as they were received.
str = ""
for i = 1 to Request.Form.Count
for each name in Request.Form
if Left(name, 1) <> "_" and Request.Form(name) is Request.Form(i) then
if str <> "" then
str = str & ","
end if
str = str & name
exit for
end if
next
next
FormFieldList = Split(str, ",")
end function
function SendMail()
dim CDOSYSMail, CDOSYSCon
Set CDOSYSMail = Server.CreateObject("CDO.Message")
Set CDOSYSCon = Server.CreateObject("CDO.Configuration")
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "web.hmns.org"
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:InetpubmailrootPickup"
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
CDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 0
CDOSYSCon.Fields.Update
Set CDOSYSMail.Configuration = CDOSYSCon
CDOSYSMail.From = fromAddr
CDOSYSMail.To = recipients
CDOSYSMail.Subject = subject
CDOSYSMail.htmlBody = body
CDOSYSMail.Send
SendMail = ""
Set CDOSYSMail = Nothing
Set CDOSYSCon = Nothing
end function
%>
View Replies !
View Related
Swap The Mouse Cursor Multiple Times?
I am using the actionscript as follows:
on (release) {
Mouse.hide();
startDrag ("_root.icon_a", true);
play ();
}
I would like to replace it with another, "icon_b" when another item is clicked. This I can do, but the "icon_a" remains where icon_b was left (obviously due to the script). Can I somehow hide "icon_a", or put it back to where it goes? There are multiple icons (leaving little scattered mousepointers all over the place), so a general purpose script would be best (i.e. I cant have a million combinations and if statements for each icon)
Thanks for your help and information in advance.
Bald Kiwi
[Edited by Bald Kiwi on 03-08-2002 at 11:42 AM]
View Replies !
View Related
How To Smart-load Same File Multiple Times?
i'm making a game where it loads the same image into 16 different game tiles. this image needs to be dynamic becuse it changes throughout the game and from day to day.
the problem is the image is actually being loaded 16 times rather than loading once and using the cache for the rest. i tried having one piece load first then loading the other 15 later, but the same problem occurs.
each of the game tiles has a different mask in it, so i can't simply duplicate the game tile movie clip 15 times.
is there a way i can just load the image once then tell all the game tiles to use this image?
any insights greatly appreciated.
View Replies !
View Related
Enter Key Launching Page Multiple Times Why?
Ok I have a code that looks like this below. It is a text field that when you type in certain words and hit enter on the keyboard (or hit the go button created) it launches that page or movie. It works great except one thing. When I hold down the enter key it keeps launching the website asigned over and over. Can I make it so it just launches once then stops. I basically want to disable the ability to hold the key down and keep launching it. Thoughts or ideas anyone?
var search:String;
function findcode() {
search = _root.find_tool.Searchbox.text;
if (search == "home") {
Content.contentPath = "flash/Home.swf";
} else if (search == "job") {
getURL("http://www.test.com/employ.htm", window="_blank");
} else {
_root.find_tool.gotoAndStop(2);
}
}
//button actions
_root.find_tool.go_btn.onPress = function() {
findcode();
trace(testbutton);
};
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
findcode();
trace(test);
}
};
Key.addListener(keyListener);
View Replies !
View Related
Using The Same Externally Loaded JPEG Multiple Times
I am having a problem with a site I am creating right now. This site needs to have around 10 JPEG loaded externally one time at the start of the movie, preloaded, then those same 10 images need to be used multiple times in the movie.
I am trying to use the attachMovie function but I cant seem to get it to work with images that are dynamically loaded in.
Is there a good way of basically loading images behind the scenes then calling them up dynamically and possibly multiple times?
this is the actionscript on the first frame right now, and while some of it has no meaning without the movie this might help give some insight into what I am trying to do.
Code:
content._visible = false
nav = content.menu.navthumbs.slider
address = content.entrypage.entry
// Image Loaders
import flash.display.BitmapData;
imageurl = "artistimages/"
var imagearray:Array = new Array("home", "home2", "profile", "profile2", "featured", "featured2", "news", "news2", "contact", "contact2");
imageloader._visible = false;
var clipLoader:MovieClipLoader = new MovieClipLoader();
var clipListener:Object = new Object();
clipLoader.addListener(clipListener);
for(i=0; i<10; i++){
_root.imageloader.createEmptyMovieClip("tempMC"+i, i+1);
clipLoader.loadClip(imageurl + imagearray[i] + ".jpg", _root.imageloader["tempMC" + i])
}
clipLoader.loadClip("artistimages/banner.jpg", content.banner)
// Preloader
this.onEnterFrame = function(){
imagel1 = _root.imageloader.tempMC1.getBytesLoaded();
imagel2 = _root.imageloader.tempMC2.getBytesLoaded();
imagel3 = _root.imageloader.tempMC3.getBytesLoaded();
imagel4 = _root.imageloader.tempMC4.getBytesLoaded();
imagel5 = _root.imageloader.tempMC5.getBytesLoaded();
imagel6 = _root.imageloader.tempMC6.getBytesLoaded();
imagel7 = _root.imageloader.tempMC7.getBytesLoaded();
imagel8 = _root.imageloader.tempMC8.getBytesLoaded();
imagel9 = _root.imageloader.tempMC9.getBytesLoaded();
imagel0 = _root.imageloader.tempMC0.getBytesLoaded();
imaget0 = _root.imageloader.tempMC0.getBytesTotal();
imaget1 = _root.imageloader.tempMC1.getBytesTotal();
imaget2 = _root.imageloader.tempMC2.getBytesTotal();
imaget3 = _root.imageloader.tempMC3.getBytesTotal();
imaget4 = _root.imageloader.tempMC4.getBytesTotal();
imaget5 = _root.imageloader.tempMC5.getBytesTotal();
imaget6 = _root.imageloader.tempMC6.getBytesTotal();
imaget7 = _root.imageloader.tempMC7.getBytesTotal();
imaget8 = _root.imageloader.tempMC8.getBytesTotal();
imaget9 = _root.imageloader.tempMC9.getBytesTotal();
l = imagel0 + imagel1 + imagel2 + imagel3 + imagel4 + imagel5 + imagel6 + imagel7 + imagel8 + imagel9
t = imaget0 + imaget1 + imaget2 + imaget3 + imaget4 + imaget5 + imaget6 + imaget7 + imaget8 + imaget9
percent = (l/t)*100
if(percent > 20 && loadingbar.mc20.active == false){
loadingbar.mc20.gotoAndPlay("loaded")
}
if(percent > 40 && loadingbar.mc40.active == false){
loadingbar.mc40.gotoAndPlay("loaded")
}
if(percent > 60 && loadingbar.mc60.active == false){
loadingbar.mc60.gotoAndPlay("loaded")
}
if(percent > 80 && loadingbar.mc80.active == false){
loadingbar.mc80.gotoAndPlay("loaded")
}
if(percent > 95 && loadingbar.mc100.active == false){
loadingbar.mc100.gotoAndPlay("loaded")
}
if(percent >= 100 && t > 1000){
if(loadingbar._currentframe == 20){
loadingbar.gotoAndPlay("out")
}
}
}
// Loaded Function
function loaded(){
address.homemc.home.imagemc.attachMovie("tempMC1", 1)
_root.content.entrypage.entry.imagemove();
_root.content.entrypage.entry.gotoAndPlay("start");
content._visible = true;
loadingbar._visible = false;
_root.content.gotoAndStop("entry")
}
View Replies !
View Related
Using The Gallery From The Tutorial Multiple Times In A Scene
Hey guys, it's my first post, I've been a lurker for a while, and can't seem to find an answer to this question. I've been trying to incorporate the code from the MX tutorial on photo galleries and it works fine when it's the only iteration. But when i try to put multiple galleries in the same scene that are all the same differing only in the instance name of the 'photo rectangle' and the source directory path for the photos.
I would like to have this series of galleries that are all lined up and slide left or right so the viewer can pick which gallery they want. So i'm wondering how do i get all these individual galleries into one movie clip sliding back and forth and still work? I've tried several things to get it to work and one of the two happens:
1)when the scene is loaded the stage is only the photo size, and one gallery is only visible (wtf?)
2)all the galleries are visible, but only one of them actually has the first image loaded, the rest only have the rectangles that are the place holders for the image visible, and if i hit the forward and backward buttons on any of the galleries, it advance only on the one gallery that has the image loaded. Even though i have changed the button code to correspond to that gallery.
I hope i have explained this well enough, i'll check back in a bit and elaborate if needed. Thanks in advance!
View Replies !
View Related
Import Tween Class Once Or Multiple Times?
Hello everyone. I am using the tween class on my first key frame of my mc. It looks like this;
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myTween:Tween = new Tween(main_mc, "_x", mx.transitions.easing.Elastic.easeOut,590, 0, 3, true);
However my question is if I have multiple mcs that will use the same code how do i reference it? Currently I have the above code duplicated on two key frames, one of the first and another after a stop keyframe.
I am thinking I should put this in a global function or maybe some other way but not sure how. Any help is appreciated.
View Replies !
View Related
What A Disaster - Images Downloading Multiple Times
I have different images at various points in my movie, all of which are loaded with the following code:
var myMCLoader:MovieClipLoader = new MovieClipLoader();
myMCLoader.loadClip("images/myImage", this);
This is not working well because:
1. The images do not download in the background until they are accessed on the timeline
2. Flash attempts to download them every time they appear.
I thought Flash would download each image in the background just once and then that would be it.
The preloaders I make preload content and then show it immediately once it's downloaded. How can I preload something and then use it later?
Also, if the user clicks the back button to return to the beginning of the timeline, the preloader kicks in again (it's on frame 1) and downloads the image again! I want Flash to download stuff just once.
Someone please help.
View Replies !
View Related
Duplcating A Movie Clip Multiple Times
Maybe some of you AS gurus can help me. I have a Movie Clip I want to duplicate when you press a button. I have that working. What I really want to do is every time the end user clicks the button the Movie Clip duplicates. So in other words I want there to be as many duplicates as there are clicks. How would I do this? Any help is greatly appreciated.
Thanx ahead of time.
View Replies !
View Related
Vertically Animating Same Tween Multiple Times
I want to animate the same movie several times using Tweens and Actionscript.
I'm trying to create a text animation where falling letters from the top of the stage animate (Elastic.easeOut) in succession to form a sentence--I want them to start so the next falls while the previous is still bouncing. So far I have just one lonely red circle animating in from above (but it looks the way I want it to):
new Tween(redBall_mc,"_y",Elastic.easeOut,redBall_mc._y, 200,2,true);
Do I need to put emptyMovieClips above the stage to hold the animating movie clip and then call them midway through the previous Tween? Should I use an onMotionChanged event handler ?
Or should I just go into After Effects and do it there and import it as an FLV? I'm a beginning Flash user, so I'd like to understand how to do it with Action Script.
Thanks so much,
View Replies !
View Related
Can Java Force 1 Swf Multiple Times In Html Page?
Hi
Im still trying to make 1 swf appear multiple times on an html page without downloading more than once.
(try it with a big swf and you'll see that each instact downloads separately).
Surely this must be possible using java?
I know you can control the order in which graphics will be called from the server using java.
Can anyone help or must I find a good java forum?
(anyone know of one?)
Thanks in advance
Dan V
View Replies !
View Related
Spacebar Key Listener Calls Function Multiple Times
My problem:
I have a file, index.swf, which contains a movieClip name loader_mc. As you might expect, I have four separate .swf files that load into loader_mc from a menu on index.swf.
On two of my .swf files, movie1.swf & movie 3.swf, I have placed code that allows the user to advance the page by clicking the spacebar as well as by clicking the next_btn.
The code works fine the first time that you open movie1.swf or movie3.swf from index.swf. However, after returning to the menu and loading a new .swf into loader_mc, the spacebar now advances two pages instead of one. The third time I've loaded a .swf into loader_mc, the spacebar will now advance 3 pages (and so on). It doesn't matter whether I load the same .swf into loader_mc or a new one (i.e. I can open movie1.swf from the main menu on index.swf 5 times and the spacebar will now advance the page 5x when moving through movie1.swf).
My Code:
Here is the code which controls page navigation. It is placed on frame 1 of movie1.swf (similar code is placed on frame 1 of movie3.swf).
// Page Navigation________________________________________ _____//
function nextScreen() {
// I don't think that the code here is the issue, it advances the page or screen 1x
}
function previousScreen() {
// I don't think that the code here is the issue, it moves the page or screen backward 1x
}
// Button Code
next_btn.onRelease = nextScreen;
previous_btn.onRelease = previousScreen;
// SpaceBar (Hitting the spacebar rather than clicking the next button)
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode() == Key.SPACE) {
nextScreen();
}
};
Key.addListener(keyListener);
The next_btn correctly calls the nextScreen() function and appropriately advances the page 1x (no matter how many times I load movie1.swf into loader_mc). Since the spacebar listener is tied to the same function, I can only assume that somehow the spacebar code is being called multiple times simultaneously.
Any idea why the spacebar code duplicates itself when movie1.swf is reloaded into loader_mc?
View Replies !
View Related
Looping Sounds Multiple Times (time Dependant)
Ok say for example I have a sound of a bell chime. I want to play this sound independent of the mainstage and have it key off local system time. So naturally I want to have my sound loop twice at 2am/pm and eleven times at 11am/pm etc.
Can this be done? Oh I hope so because that would be mega sweet.
View Replies !
View Related
Looping Sounds Multiple Times (time Dependant)
Ok say for example I have a sound of a bell chime. I want to play this sound independent of the mainstage and have it key off local system time. So naturally I want to have my sound loop twice at 2am/pm and eleven times at 11am/pm etc.
Can this be done? Oh I hope so because that would be mega sweet.
View Replies !
View Related
Duplicate Movieclip Multiple Times Behind Lead Clip On A Motion Path
I dont know if any of you are familiar with the "flurry" screensaver on a mac? basically a bunch of streams of light moving expanding and disappearing randomly. I want to recreate something similar to this in flash.
I've tried to create a onEnterFrame function and it's not doing what I want of course. I AM a newby... My thinking is if I can create an empty movieclip, and inside of it create this animation of a glowing ball along a motion guide that might be transformed larger at one point in the path, then I can write code on the main timeline frame 1 of the empty movieclip containing the motion guide animation. Something that will repeat the duplication of the movie clip as its moving along the path and have each duplicate follow the lead. Ideally, the opacity of these clips would decrease on each duplication.
my weak attempt:
targetMC.onEnterFrame = function () {
_root.targetMC.duplicateMovieClip ("targetMC"+"x", x );
x++;
}
View Replies !
View Related
Focus Stuck In INPUT Textfield After Hitting Enter Multiple Times
Ok this was just brought to my attention...I have a search input textfield on stage that searches my list component...there is no search button, instead the search is performed 1 second after the user stops typing...(this is done with a key listener)...however the input focus gets stuck in the textfield if you type something (anything) and hit the enter key multiple times...I hit it like 5-10 real quick....then I tried to click my address bar in the browser, and I am unable to type a new URL...it just continues to type in the input text field on screen...any ideas? This doesn't happen every time...but for the most part the focus gets stuck when you hit enter a few times...
http://www.expocadvr.com/new/default.html
let me know if you guys know anything about this...
View Replies !
View Related
Focus Stuck In INPUT Textfield After Hitting Enter Multiple Times
Ok this was just brought to my attention...I have a search input textfield on stage that searches my list component...there is no search button, instead the search is performed 1 second after the user stops typing...(this is done with a key listener)...however the input focus gets stuck in the textfield if you type something (anything) and hit the enter key multiple times...I hit it like 5-10 real quick....then I tried to click my address bar in the browser, and I am unable to type a new URL...it just continues to type in the input text field on screen...any ideas? This doesn't happen every time...but for the most part the focus gets stuck when you hit enter a few times...
http://www.expocadvr.com/new/default.html
let me know if you guys know anything about this...
View Replies !
View Related
Loading Times
Just a question about the loading times of flash movies on webpages::
Does the server that the flash movie is on have anything to do with how fast it loads? I've seen some flash movies that have lots of bitmap images and audio files that will start playing almost right away. But on my Geocities site I've got animations with bitmaps and audio that I have optimized for the smallest file sizes and they still take a while to load. Is there a way to get them to start playing faster or is it just becuase I'm on Geocities?
http://www.geocities.com/BeatsofPeace
http://www.geocities.com/Beatiesandmilk
View Replies !
View Related
HELP- Loading Times
PLZ help
I have created a grid layout, in each of the squares of the grid is a movie-clip, i have copy and pasted the same clip into each of the squares. There are a few hundred squares, each with the same movie-clip. It creates a kinda mouse trail effect when u roll-over, (the clips have a roll-over command to play).
But heres the problem ... it takes way too long to load. I thought cos i used the same instance and movie-clip in each square, that it would only have to load the clip once. What am i doin wrong? Is there another way or am i stuck with the long loading time?
thnks
View Replies !
View Related
HELP Loading Times
PLZ help
I have created a grid layout, in each of the squares of the grid is a movie-clip, i have copy and pasted the same clip into each of the squares. There are a few hundred squares, each with the same movie-clip. It creates a kinda mouse trail effect when u roll-over, (the clips have a roll-over command to play).
But heres the problem ... it takes way too long to load. I thought cos i used the same instance and movie-clip in each square, that it would only have to load the clip once. What am i doin wrong? Is there another way or am i stuck with the long loading time?
thnks
View Replies !
View Related
|