ActionScript 2.0 :: Adding To Variables To UnLoadMovie?
Apr 7, 2009
I'm a student web designer from Toronto, ON working on a flash interface for an art show.In our flash file (AS 2.0), I need a piece of code to constantly check a set of variables. If the variable reaches 2, I want it to unload the current movie, therefore I also have a set of buttons which each increase the current variable by +1 every time they are clicked. Therefore once 2 buttons were clicked, the movie would be unloaded.[code]
View 4 Replies
Similar Posts:
Oct 29, 2009
I have imported some info from an xml file into my movie. The info from this file is then displayed in dynamic text boxes. Three of these text boxes show a price which displays fine. However i need the contents of these text boxes to be added together in another dynamic text box called total. I need this total to update as the price fields change. I just cant figure it out.
Here is my code which is placed at frame 1 of my movie:
The last line of code is along the lines of how i think it should work
stop();
bar._visible = false;
bar2._visible = false;
bar3._visible = false;
[Code]....
View 1 Replies
Mar 30, 2009
I am trying to have a movie unload in a different scene using this bit of script:
if (ct == 15) {
_root.gotoAndPlay("winner");
unloadMovie(this.parent.wally);
}
The movieclip is called "wally". It is just not working.
View 2 Replies
Jul 29, 2010
I am having a similar issue to this post except that I am using only AS2 at the moment.[URL]..I call a swf file to load into a loader like this music_mc.loadMovie("music/song.swf").
When I unload the movie clip like this: music_mc.unloadMovie() and try and load it again, it does not want to load again.
View 1 Replies
Jun 28, 2010
I have a set of buttons on a map that when clicked load in a zoomed version jpg file into an empty movie clip. When the loaded jpg / mc is clicked, I want the loaded movie to fade out as it unloads. The fade in is working fine, but I've tried several examples I've found online for the fade out and none of worked yet.
View 1 Replies
May 10, 2011
I have a flash game that randomly drops balls and you try to catch them however once you win or loose I cant get the balls to stop falling?
Code:
//random ball fall
allBalls = new Array();
depth = 0;
function makeNewClip() {
[code]....
View 1 Replies
Jul 3, 2009
(Using AS3) I'm doing a simple grid layout of boxes (movieClips), i'm then trying to save their current position to each of the movieClips. So in AS2 i'd do something like ...
obj.origX = obj._x;
obj.origY = obj._y;
but it's saying; 1119: Access of possibly undefined property targetX through a reference with static type flash.displayisplayObject. How can i add custom variables to movieClips?
View 3 Replies
Nov 22, 2009
Is there an easy way to add a variable into A HREF tag within as3?Example:var myVariable = "hello";<a href = 'event:myVariable' </a>Of course, that doesn't work, but how would I go about making it work? This is for a dynamic project, so I need to call upon variables within the A HREF in order for this to work.
View 4 Replies
Dec 22, 2003
I understanding how to add, multiply, etc. external, standalone numerical variables:
var salBase = new LoadVars();
salBase.Sal = new Number();
salBase.MA = new Number();
[code]....
View 4 Replies
Dec 4, 2009
I am making this site that reaquires me to unload a movie when i press the button but after i need another movie to load. How do I do this. These are the two movies:unloadMovie:Photo_HolderloadMovieThumbs_Holder
View 5 Replies
Sep 17, 2010
i have this code that load on a keyframe
loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
info.text = Math.round((bytesLoaded/bytesTotal)*100)+"%";
[Code]....
Because the swf_loader are mp3 player and if i change page wihout having press the stop button first the music is still playing. I have try to just add swf_loader.unloadMovie(); on every other keyframe but it doesnt work. i guess i have to find out where this swf_loader exist/is included right?
View 5 Replies
Jan 31, 2009
im making this website in AS2 using SWFaddress for the first time. everytime a new page in flash is requested trough swfaddress i need the menu to be remade, so i unload the previous menuitems en load new ones.
the problem is if the unloadmovie works the new items aren't made, but if i reload that same page it will show. so when items are unloaded new ones aren't made and if no items are there to be unloaded new ones are made...
here's my code
ActionScript Code:
function createMenuNow(){
trace("_______create menu now_______");
[Code].....
View 1 Replies
May 9, 2002
Is there a way to create something like an "on unloadMovie"-script?
View 3 Replies
May 17, 2009
I meant to call it "Convert a value to a variable". Using CS3, AS2: If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?
Ex:
color = "blue"
box = "color"
(Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at... I think.
View 21 Replies
Aug 23, 2010
I meant to call it "Convert a value to a variable".Using CS3, AS2:If I have a variable that's a string value = the name of another variable, can I extract the value and then look for the extracted value's matching variable name to get it's value?[code](Assuming I don't know the value of box) How would I get the value of "box" out so I could search for the value "color" as if it were a variable? I need to convert a value to a variable name is what i'm getting at.
View 4 Replies
Sep 22, 2009
I've created and XML object that's working fine and I want the user to be able to add to the XML dynamically, using an input text field and appendChild() So, what is the syntax to use so that I can put in the text they enter as an attribute of a node of my current XML object? Here's what I've got for adding to the XML (stripped down obviously):
ActionScript Code:
var xmlData:XML = new XML();
var clientToAdd:String = userInput.text;
xmlData.appendChild(<project name=clientToAdd></project>);
How can I take the variable clientToAdd and make it the attribute "name" of the "project" node?
View 5 Replies
Aug 25, 2010
I've designed an as3 flash banner with 3 input fields. The user fills in these fields and clicks a button. The text from these fields are then stored as variables, which needs to be included in the target url - like this:
websitestuff...?a=1&b=2&c=3
This is no problem. However, here's the issue: The banner needs to use clickTAG as it will be uploaded to Google Adwords. I can make the clickTAG part work, but have been unsuccessful in also adding the 3 variables after the url.
View 0 Replies
Feb 24, 2011
Having some issues with some variables not adding together to make a new number. Instead they are appending to each other as if adding characters onto a string rather than a number. Here is my code.
ActionScript Code:
var dispenserPos:Object = {x1:"41", y1:"180", x2:"283", y2:"180", x3:"530", y3:"180", x4:"775", y4:"180"};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
[Code] .....
It should be tracing out 388 instead of the numbers appended onto one another.
View 2 Replies
Oct 21, 2007
I've been building a web based order form and my client want the ability to add items (as many as you want) and for them to be totalled up. I've used Kirupas Scrollpane with Dynamic Mc's tutorial to add my products, but I can't seem to add them up! Each product adds up it's subtotal in the dynamically attached Mc and outputs the variable 'subtotal' In my root I have this function to call the subtotals, but I can't seem to get it to add up each of them to output a total...
[Code]...
View 3 Replies
Feb 1, 2004
I'm struggling with a project. I'll try and describe it. 10 mc are loaded randomly with one of two ext.swf's. Each time you click/drag on one, 1 of 6 questions are randomly loaded from an array into a text box on the main timeline. I need to count and add up how many of each of the 2 ext.swf's have loaded and whether they have an x pos < or > 300. My first problem is: The question shows up in the text box when the mc is clicked/dragged but when I trace it, the question that shows in the output doesn't match the one that's loaded into the text box?The second problem is a big one. I need to be steered in the right direction as to keep track of what is where on stage. I only have a vague sense of how to go about it, and combining all the bits is too much.
1. I need to trace the question2. I need to say if the question is 'blah' do this3. The 'do this' is pretty complicated. I need to add up the #1 movies that have an x pos of <300 and the #1 movies that have an x pos of >300 and then do the same for the #0 movies. Then I need to compare a users input answer to the correct one!!! The question AS is in the external swf. [AS]stop();
// Questions Array
question = new Array(); {
question[0] = "How many hedgehogs are in the bed?";
[code]....
View 11 Replies
Mar 19, 2004
If I want to add or substract number variables, how can I name them to indicate they are numbers and how can I do basic math with them? If I try adding common variables like
_root.answer = _root.var1+_root.var2;
and if var 1 is = 1
and var 2 is = 2
The answer is 12 not 3
View 5 Replies
Jan 8, 2010
I'm new and I've got a problem I've been trying to fix for a couple days and haven't been able to.I am loading youtube videos in to movie clips with actionscript on a frame:
this.video_mc1.loadMovie ("http://www.youtube.com/v/URL");
this.video_mc2.loadMovie ("http://www.youtube.com/v/URL");
this.video_mc3.loadMovie ("http://www.youtube.com/v/URL");
[code]....
View 2 Replies
May 21, 2005
When a button is clicked in my main movie, a swf loads in a container clip. When the "BACK" button is clicked on the loaded .swf, the .swf is unloaded but the buttons I have on my main timeline no longer work.
code on main timeline of main movie:
Code:
this.main.nav.project.onRelease = function() {
trace("Project Clicked");
_level0.main.play();
[Code]....
View 1 Replies
Oct 18, 2005
I am building a website that has a separate .swf for each page of the site. Each page is loaded into shell_mc using loadMovie. When a new page loads, I run shell_mc.unloadMovie before calling shell_mc.loadMovie(newPage). I am just wondering if the unloadMovie command will destroy everything in the current page that might take up memory before it begins loading a new page.
View 1 Replies
Apr 13, 2007
I am trying to incorporate the facility to recover an object that has been deleted by the user. When he presses delete, i unload the movieclip. So if I want to recover it, complete with its last width, height, x and y positions, how do I do it? Is there some inbuilt function? or do I have to use some programming to do it, like save the object properties before deleting and all? The object could be any one of about 5-6 of them in my library, so knowing at run time which one to attach is impossible. So I need something to recover exactly the movie clip that was unloaded. I don't think attaching a new one and setting its properties will work. Very simply, I could just set the _visible to false when he presses delete, but then, thats not a very good practice I feel.
View 9 Replies
Apr 27, 2007
I have an application that reads a PHP script and populates the Flash applets using the following on frame 1:
[Code]...
A combobox (created with the returned data) is created on frame 61. When a selection is chosen in the combobox I need to add the value returned from the combobox to the variable catvar, add this variable to the LoadVars object and run the script again. It seems to set c.catvar initially but when I use the 'sendAndLoad command the second time c.catvar isn't included. Is it possible to add variables to a LoadVars object created
on frame 1 from frame 61?
View 1 Replies
Jan 16, 2012
I'm building a Flash banner (as3) for AdWords, but I can't find in their documentation whether it is possible to add hash or querystring variables to appear in the eventual target url when u are using a clickTAG. Ideally I would like to use both. For example, my banner has four input fields and I would like to build my target url thusly:
var base:String= "http://www.example.com";
var qs:String= "?one=" + input1.text + "&two=" + input2.text;
var hs:String= "#three=" + input3.text + "&four=" + input4.text;
var targetUrl:String= base + qs + hs;
flash.net.navigateToURL(new URLRequest(targetUrl), "_blank");
Is this possible with AdWords while using clickTAG?
View 1 Replies
Feb 3, 2010
I'm having trouble with a script I'm writing and don't understand why. I have
[Code]....
on a a button that I have, but when i test my file and click on the button, it doesn't change frames.
View 4 Replies
May 15, 2008
I have a form that will require the user to type in some figures (into the input text fields) which will need to be totaled up at the end.
Would it be recommended to execute this function by sending it to php and then back to flash or is there a better way to do it within flash?
Again all I want to do is get the sum of all input text variables (all having number values).
View 3 Replies
Apr 1, 2009
I have created an interface that uses a lot of the loadMovie command using levels. Once I have loaded a movie on say level 3...in that level 3 movieclip I will have another navigation that will load and then use the loadMovie command to load movie on level 3 as well. It loads it correctly but the back button that would contain the unloadMovie(3) command isn't unloading, say if the user wants to go back.
View 2 Replies