ActionScript 2.0 :: Reloading Movieclip As Variables Change?
Jun 18, 2006
i am working on a flash website and i have for the first time made everything dynamically loading from outside of the SWF to reduce the file size. I have a text file which is dynamically loaded into a text box, which i have defined in a variable called "textfile". I want to reload the movieclip on the click of a button and at the same time change the variable for the text file to be opened into the text box. so as i click content, the variable changes to content and the movieclip reloads, showing content.txt in the text box
View 1 Replies
Similar Posts:
Jan 25, 2005
I have a flash header that receives random text from a database through a PHP page. I'm using the loadVariables function to bring in the first random text and that works fine. I then have a button that should access the PHP again and retrieve another random text set from the database (once again using the loadVariables function).
Whenever I use the loadVariables function on the button to renew the random text, it brings up the same text over and over again. When I use loadVariablesNum it works, but opens up a blank page with the output of the variables (getURL also works, opening up a blank page).
Is there a way for me to use the loadVariablesNum without having the page popup with the variables printed out? Or better yet, is there a way to just use the loadVariables to renew the info?
View 3 Replies
May 19, 2011
I have 6 variables that load into 6 different dynamic text boxes. They all load fine when I load them, but only the first one updates after 6 seconds. I have them all set to update after 6 seconds. Here is the code that is working fine followed by the code that isn't. I'm using CS5.5
1st Box that works fine:
myData = new LoadVars();
myData.onLoad = function() {
myText_txt.text = this.myVariable;
};
[Code].....
View 2 Replies
Jul 20, 2004
I know there were many messages posted regarding sending variables from flash to php. I wrote a small code where in I used send() method of LoadVar object, it sends the message but it reloads the php page which I do not want it to do. I tried using sendAndLoad() and here it does not send any variable at all. Below is my sample code.
PHP code: (recieve.php)
<?php
$s = "12";
$r = $_POST['name'];
[Code].....
View 1 Replies
Jul 20, 2004
I know there were many messages posted regarding sending variables from flash to php. But I am facing a problem. I wrote a small code where in I used send() method of LoadVar object, it sends the message but it reloads the php page which I do not want it to do. I tried using sendAndLoad() and here it does not send any variable at all.[code]
View 1 Replies
Nov 5, 2009
I have frame 1 and frame 2 which are almost the same. Both have a movie clip TAB. This tab has buttons: button 1, button 2, button 3. When I click button 1, it will show a text, and so on..If I am at frame 1, and I click button 2, it is ok. But when I go to frame 2, TAB movieclip is still at button 2! I think it is not reloading.
View 2 Replies
Jun 16, 2011
URL...Once you get to my portfolio menu homepage, click on Print design. Everything there loads fine.The trouble is going back to the portfolio movieclip and having it display those menu buttons again.As you can see, if you try to click the view portfolio button at the top, it loads that movieclip to wherever you left off at.Basically, my question is: How can I have my "view portfolio" button reload/refresh the movieclip (page1) from the beginning in my pagecontainer_mc?
-page1 is a movieclip that shows my portfolio buttons.
-page2 is a movieclip that show the "about me" section.
-pagecontainer_mc is an empty movieclip that loads page1 or page2.[code]
View 5 Replies
May 19, 2009
I have a website i'm working onnd it works fine in safari and firefox, but when I run it in explorer it doesn't Whats going on is that when you go to the homes section of the site, each home's section is a swf that is loaded into the main movieclip.In explorer these swfs load fine the first time around, but when you return and want to load the swf/section and see it again, they get stuck and although they appear to load, i'm not sure if they have and are getting stuck on the first frame or they are not loading, or there is something going on with the cache.I am loading from the main movieclip using a container with the following code:
var homeLdr:Loader = new Loader();var homeURL:String = (MovieClip(root).gotoArea)+"Eng.swf";
//gotoArea names the swf to loadvar homeURLReq:URLRequest = new
[code].....
View 6 Replies
May 3, 2011
I'm new to AS3 and programming in general and thought I could find some help here. I've tried researching and fixing this problem myself but I can't seem to figure it out.
I'm essentially making a version of Pong as a small project to get myself into programming using AS3. My problem is I've got the ball moving left towards the edge of the stage but I can't make it come back once it reaches the border.
I've an idea of what needs to be done, I need to make a function that sends the ball off to the side of the screen then have an if statement that detects when the ball reaches the border that then tells the ball to stop moving in that direction and move to the other side of the screen. [code]...
View 2 Replies
Jul 15, 2010
I'm making a fighting game and so far all the controls are good, characters can walk, run attack etc. My problem: The character is a MovieClip, Guy, and is exported to a class Guy. In Guy.as I have a boolean "hitting" which is set to default "false". If the Guy object hitTests an enemy while "hitting" is true, the enemy will take tamage.
In the Guy MovieClip there are about 7 frames, each with its own animation. 3 of those frames are attacking animations in form of MovieClips, i.e, if we click them we get another set of frames. Say one of the attack MovieClips has 10 frames in it, frame 7 of 10 is where the punch actually lands, this is when I want the enemy to take damage, not before (while the character is still moving his hand forward). Seeing as this frame is inside a MovieClip which is inside another MovieClip(Guy), is there a way to access the property "hitting" with this inner frame?
View 4 Replies
Oct 21, 2010
In my previous topic whitelynx_nivla gave me a code, which I edited. I'm using it to set variables when a certain key is pressed.But the loader can't access the variables and change them.[code]
View 0 Replies
Nov 22, 2005
Right, is it possible to change the varaible of an object within flash (5) through the use of a textbox? The reason being we're doing a group project with Flash and MaxMSP and when a video camera picks up movement, numbers will be sent from MaxMSP through to flash.
Thus, when these numbers "arrive" in flash I want them to trigger certain events. For instance (where this code resides in the movie clip: 'tree'):
Code:
onClipEvent(load){
if(textbox=5){
gotoAndPlay("grow");
}
}
Here, the idea is that when '5' is sent to flash a tree will grow and when 4 is sent something else will grow etc... However, because I don't want stuff growing all the time I need to change the variable of an object. I presume a textbox would be the easiest way of going about it
View 9 Replies
Aug 5, 2011
I am doing some server communication in AS3 / PHP / MySQL and I was wondering if there was a way to change a variable just before the user closes Flash?
Example: User closes browser or tab and Flash updates a variable before it closes the player.
I would like to be able to send the message to the server so that it knows that the user quit as it happens.
View 3 Replies
May 27, 2004
I'm trying to use actionscript in a button to increment variables in my program. ie. when you click the button it increments a variable and so displays different information in one of my dynamic text boxes. The program doesn't seem to recognise the button input. I understand you have to give your button an instance name but I'm not sure how to set up the code to recognise this input.
View 3 Replies
Sep 4, 2010
The plan is to set up variables to react to a flashvars value like this:
[Code]...
There would be many mainVars (over 100, actually) and this setup isn't working.
View 1 Replies
Sep 4, 2010
The plan is to set up variables to react to a flashvars value like this:[code=html]<param name="flashvars" value="mainVars=1" />[/code]
[Code]...
There would be many mainVars (over 100, actually) and this setup isn't working.
View 2 Replies
Sep 4, 2010
The plan is to set up variables to react to a flashvars value like this:
Code:
<param name="flashvars" value="mainVars=1" />
Code:
var videoArray:Array;
var videoTitle:String;
var videoFile:String;
[Code]....
There would be many mainVars (over 100, actually) and this setup isn't working.
View 0 Replies
Oct 19, 2010
I have this code:
ActionScript Code:
for (var j:int = 0; j < 20; j++){
if (values==j){
var "ingredient"+j:"Ingredient"+j = new "Ingredient"+j();
[Code].....
it doesn't work for what are probably obvious reasons but I show it to give you an idea of what I'm trying to do which is change the name of the variables while the program is running.
View 6 Replies
May 27, 2004
I'm trying to use actionscript in a button to increment variables in my program. ie. when you click the button it increments a variable and so displays different information in one of my dynamic text boxes. The program doesn't seem to recognise the button input. I understand you have to give your button an instance name but I'm not sure how to set up the code to recognise this input. The code in my button is on (release) { buttonup++;} This is meant to increment a variable of that name but doesn't appear to work.
View 3 Replies
Apr 26, 2003
I have a movie which consists of 4 buttons( PLAY, PREVIOUS, NEXT and STOP)
[Code]...
These buttons work correctly and advance or reverse in sequencial order (slide1,slide2,slide3,slide4). However the movie can run from start to finish wihtout the use of the navigation. My problem is that if I let the movies run independently and then choose to use the next button while(for example) "slide3" is playing, the movie jumps to "slide1". Note that these slide labels are located within movieclip named "allunits" I know that the variable currentSlide is still equal to 1 thus returning the playhead to label "slide1".
View 2 Replies
Dec 20, 2011
how i could change the movieclip border around a circular object/movieclip.cuz know my my hitTestObject will also test on the corner of the movieClip and not the actual see able object like i show down here how coud i change this border to the second image?
View 3 Replies
Feb 19, 2009
I've got a bunch of mc's which I've put in an array. With these mc's you can do a lot of different things, like dragdrop and rotation. I also got a button which on mouse down, changes the image of the mc. It only changes the image.. not the size. So far so good...But when I've clicked the button and the mc's all change their image... They are not able to dragdrop / rotation anymore. I do not understand why this is happening... because by clicking that button... it doesn't change the names of the mc's.....here is the code:
ActionScript Code:
library = new mc_library();
library.x = 100;[code]....
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
Feb 27, 2006
Is there a way to have a global variable in my main movie, and when certain external swfs load in, it change the value of the variable?
View 2 Replies
Nov 7, 2008
I have been using AS2 for a while now but am having some trouble when it comes to the internet side, I basically would like to be able to change the value of a varible on a web page or something and use this value on a different computer, like an mmorpg but it does not have to be that fast, I have looked around and am having trouble working it out, I know you can use servers and stuff but I don't want to have my computer running 24/7 so someone else can use it.
View 1 Replies
Mar 20, 2009
My intention is to have an array with several variables, each one with a different name, all of them of the type 'Number'. This I can do.What I can't do is to access the variables using the array's index.
Paste this on your frame 1:
Code:
trace("======at frame 1======");
//objects//
var objects:Array = new Array();
[code]....
As you can see, the code is changing the value of the array element and not the value of the variable inside the array element.
View 6 Replies
Jan 23, 2005
I am having problems with the
getcoord = xycoordMap[x][y].split(":");
xcoord = getcoord[0].toString();
ycoord = getcoord[1].toString();
xcoord0 = xcoord + "";
ycoord0 = ycoord + "";
code... as you can see in the code I converted three times just to verify that I was working with strings. What happens if you run this script, the variables xcoord0 and ycoord0 magicly change in value when they are used in the IF statement (see the traces). What is going on?? what am I doing worng?? Is there an issue with my 2d Array?
[Code]....
View 3 Replies
Jan 7, 2010
Using a movieclip rollover to change another movieclip timeline?
View 1 Replies
Jan 14, 2007
figuring out a method to reset variables on a list component change for my mp3 player. everytime i select a new song on the list or select the same song the timer for song position keeps going and nothing resets. here is the action script:
ActionScript Code:
var artistList:mx.controls.List;
var sound:Sound = new Sound();
info_txt.autoSize = true;
[Code].....
View 4 Replies
Dec 18, 2007
I'm trying to use associative arrays to store my variables but am looking for a solution to change the value of array1[i] to array2[i]. Since it's an associative array, the only way I know how to loop through these kinds of arrays is by the following:
Code:
for(var i in array1) {
trace(array1[i];
}
What I would do when using indexed arrays to change the value of array1[i] to array2[i] would be something like this:
Code:
for(i=0; i<array1.length; i++) {
array1[i] = array2[i];
}
However, I can't see any way you can do this with associative arrays because they do not have a numbered index such that in a loop you could
say array1[i] = array2[i] .
So I'm looking for a way to do this with associative arrays.
View 14 Replies