ActionScript 2.0 :: Refresh / Reread Variables Within Movie
Aug 31, 2009
I have created a little virtual shop that reads the amount of money a player has and then enables different products to be bought. Eg - if someone has 200 points they can buy a ball for 20 or a bat for 200. This all works fine for one purchase. All of the items check the score and are enabled or disabled fine. However, say I purchase the ball - the points reduces by 20 to 180 - not a problem - but the bat is still enabled even though the variable has reduced so they can't afford it.Is there a way of refreshing the variable so that the items are constantly monitoring the variable amounts?[code]I put it in an mc so that if they buy the item it goes to a different frame where there is no mc to check the myscore var and therefore they've bought it!
View 1 Replies
Similar Posts:
Sep 19, 2010
I am tying to find a way to refresh variables with new data. I am using PHP and MySQL to randomly assign new data to a variable when the script is called. This new data is passed to Flash as in a variable using these functions:
varReceiver = new LoadVars();
varReceiver.load("iat_config.php");
varReceiver.onLoad = function(success){
[code]....
So my problem is that every time I call my movie to go to this frame that contains this actionscript, it does not provide me with new variables. Another important variable I need to change every time the frame occurs is startTime = getTimer(); However, the variable startTime will stay they same and not change when the frame is recalled.
View 1 Replies
Mar 24, 2011
I'm using swfObject to load my flash. I need to call a function or pass new variables into the flash file without it reloading. The user clicks on a button and the flash text needs to change. I have it working but it reloads the flash file and looks very choppy.
View 1 Replies
Jul 15, 2004
how to refresh the dynamic varaibles using the loadVariables command? At the moment they are caching on the web - but it works the way i want it when tested in Flash.
View 1 Replies
Sep 30, 2010
I had an issue with my index.html testing on IE and the preloader just stalls on "loading 0%". he told me that locally the progress event doesn't have time to load and to try uploading it to your server and see if it works. It worked just fine. Rah Rah Kglad.
So today I'm fine tuning the swf/ fla to clean it up. Reduced some picture sizes and deleted unused files and reduced the swf from 4000 KB to 350 KB Rah Rah Gene. replaced the swf in Dreamweaver and re-uploaded with Filezilla. Rah ah Filezilla.
Everything working great and my preload went from 23 seconds to less than 3. So I'm real happy except for one small issue. Firefox and IE both do this. If I hit the refresh button, it stalls on "loading 0%" once again just like it did locally.
If I hit the refresh several times it WILL refresh randomly....2 times refresh......10 times refresh etc.
[URL]
Spoke to my hosting company who said everything seems fine on the server. BTW he said Chrome did NOT have this issue Rah Rah Chrome.
View 1 Replies
Sep 24, 2010
Some Time movie is not loading even refresh. It uses ExternalInterface to post/get some events. Where I need to verify. It is very urgent. Is any work around.
View 2 Replies
Jun 8, 2009
I have a flash movie that I want to play once. If someone refreshes the page or goes to another page with same movie, I want it not to replay the animation. Is there any way to do that in Flash 8 and without frames or iframes.
View 1 Replies
Jun 8, 2009
I have a flash movie that I want to play once. If someone refreshes the page or goes to another page with same movie, I want it not to replay the animation. Is there any way to do that in Flash 8 and without frames or iframes.
View 6 Replies
Aug 20, 2008
This seems like a simple script I want to write, but for the past 2 days I can't seem to get it started...
Here's what I want to do:
I have a flash movie that I want to play once. If someone refreshes the page, I want it to check to see if it has already been viewed that day and if so, just go to the last frame of the movie instead of playing all over again.
Here's sort of a flowchart:
1. Start a flash cookie
2. Set a variable for a "check date" and "if viewed"
3. Check "if viewed" - no=play yes=checkdate
4. If checkdate = today=don't play goto last frame newday=replay movie and set played for that day.
View 14 Replies
Jun 10, 2009
I've been making a game and want it so you can play again - when I try and send it back to frame 1 (it's preloader) it doesn't really work. I was wondering if there was a way of basically refreshing or reloading the whole swf file?
View 3 Replies
May 13, 2011
I have a flash banner on every page in my site. I want it to continue playing rather than reloading when users change pages. Ive read that this can be achieved using flashvars.
I have this on frame 1 of my fla file now:
var mySharedObject:SharedObject = SharedObject.getLocal("displayCookie");
if(mySharedObject.data.displayed == true){
gotoAndPlay(currentFrame);
trace("cookie found");
[Code] ....
But I don't know how to give the currentFrame the value it had at the time the page was refreshed. How do I put that in there?
View 2 Replies
Aug 16, 2005
i am having trouble with xml. i am trying to work it so that if the variable that comes from the xml file changes to a certain number it will automatically change the movie clip i have on the movie. I have also attached the fla and xml file
View 1 Replies
Jun 18, 2007
Can anybody tell me if it is possible to limit the bandwidth or screen refresh rate that a flash movie uses? I have a large number of virtual desktops which use RDP and flash performance is terrible.
If I look at a site in IE that use lots of flash, my RDP session can even hang sometimes or more likely become completely unusable.
View 1 Replies
May 28, 2002
I'm trying to do a demo with a fastforward button and a rewind button that will go to the next scene and previous scene...however, due to the format that my predecessor created used...I'm stuck with alot of scenes. The navbar (ff and rewind buttons) is in a .swf file called main. The actual demo is in demo3.swf. I created a loader scene to redirect to the correct scene (when ff and rewind are hit), but I'm not sure how to pass the variables needed from the main movie.
View 4 Replies
Jun 4, 2002
Make things very simple, I need to pass variables between different movie clips (.swf's) on my main movie. It seems as tho my variables are only local, not global, i just need to know how to initialize global variables, and how to use the global variables in my other swf's.
View 14 Replies
Jul 23, 2009
I have a movie, let's say MainMovie. Within this movie I have another movie, let's call it MovieWithin.
I have a few variables in the MainMovie such as MyColour, MyHeight, etc.
In the MovieWithin, I want to place the following code:
onload()
{
ThisColour = _root.MyColour;
ThisHeight = _root.MyHeight;
}
So that when it loads I can pass variables to the movie. But this isn't working for me!
It seems that I can access variables going in one direction, but not in the other.
For instance if I was in the MainMovie, and had a code such as: MyHeight = this.MovieWithin.ThisHeight
Then this would work absolutely fine! But if I try to access variables in the other direction, from the inner movie to the outer movie, it just won't have it!
I've tried the _parent technique with no joy!
Basically I want to be able to load several movies (not at the same time!) into my MovieWithin, but be able to control their state on loading by accessing the variables in the MainMovie.
View 0 Replies
Dec 11, 2009
I'm using a Flash accordion component. This component is made of movies and includes text boxes which people can enter locations into. These values are processed on the main stage on the click of a button. My question is, how do i get the value that was entered in the accordion movies into a variable on the main stage that the can be used. At the moment I have a text box on the page, and have added this code to the first frame. Although I think the value is stuck within the movie and cant be accessed on the main stage.
keyword = varkeyword
View 4 Replies
Jan 28, 2009
I keep having problems with variables in movie clips
_level0.NumberSectionsEntry.ThreeMeterBays
keeps appearing in the text fields
if I change the variables on the text field in hte mc from ThreeMeterBays to _root.ThreeMeterBays they work do all variables have to call _root?
View 2 Replies
May 26, 2010
So I have used this code:
_root.loadvars = new LoadVars();
_root.mainoslataus.onLoad = function(succes)
{[code]...........
The problem is that I want to use it at the preloader frame, and display it same time when flash file is loading. But it won't work, it loads when the file has fully loaded, and then its too late.I know that I could use another swf to load this swf and display it then, but its not what I want.
View 0 Replies
May 17, 2005
I have a PHP script returning a list of variables to flash. The variables are named something like this:-
photo1
photo2
photo3
price1
price2
[Code]...
How can I create n number of identical movieclips with say three dynamic text boxes in each to show the three variables price, photo and modelnum but will vary with the value of n for each one.
View 14 Replies
Feb 7, 2008
which is the use of having "variable movieClips"?? ...I mean, if I have this:
Code:
var SuperAwesomeGuy:MovieClip = new MovieClip()
the only usefull things I could do with it is the following (which is very usefull if you are using a "for...in"):
Code:
var variableMovie:MovieClip = _root.attachMovie("movie","movie-with-complicated-name"+i,random_depth)
variableMovie._x = 200
variableMovie._y = 500
and I didn't found anything else useful...
View 1 Replies
Feb 3, 2009
What I am trying to do used to be very simple. I have a variable set in move A. Movie A embeds another move (Movie B) into a movie clip. Is there a simple way to call a varaible from movie a through movie b?If you need a little more detail here is what I am trying to accomplish. Movie a loads a list of information from a xml file and uses that data to set some variables within the content. (ie. based on the data it might caculate that the user listed in the xml file likes golf) Then it sets golf to true in Movie A. My problem is i need this variable throughout several of my movies and I dont want to do the calculation in ever single movie clip. I am sure I am making this much harder than it needs to be.
View 3 Replies
Apr 14, 2012
Is there a there a way to run a movie with url variables passed? So instead of test.swf, it would run as test.swf?var=1&var2=2
View 1 Replies
Apr 26, 2009
I am trying to create an interactive flash that users will be able to manipulate certain events in the game. I was was wondering if it was possible to1. Make objects appear or disappear in a frame if a variable is set to a particular number.n example being a window, if you click on it, it opens and closes if clicked on again. If you open the window and go to a different frame, is there a way to make it be open when you go back? 2. Determine the next frame. An example being a door, if the variable is 1 then the door would open when clicked, to the next frame. If it is 0 then it would tell you you need a key or such.I wrapped my head around creating variables and manipulating variables using basic functions.The only thing I am having problems with is if there is an "if"chieve these two tasks.Edit: Figured out number 2:'blueButton' is the variable, when pressed it changes its stored number by two. I linked it to another button which this code is attached to...
PHP Code:
on (release) {
if (_root.blueButton == 2) {
[code].....
View 1 Replies
Feb 2, 2012
I want to change variables on the main stage's code from within a movie clip.
Say for example, I want to change a variable called 'chair'
In AS2, this is how I would do it:
(on the main stage)
Code:
chair = 2;
(in the movie clip)
[Code].....
But all I get is a 1119 error saying 'Access of possibly undefined property chair through a reference with static type flash.displayisplayObject.'
View 3 Replies
Jan 21, 2010
How can I trace all available Movie Clip variables and functions?
View 5 Replies
Apr 27, 2010
How i can convert gecko object to a movie clip
function finish(boxname, arrayname:Array):void {
for each (var item:String in arrayname) {
trace(boxname+"_"+item);
[Code]....
View 2 Replies
Nov 10, 2009
i am trying to make a basic preloader for an AS3 site. I followed the tutorial on this site (Preloading actionscript 3 the easy way) where its similar to AS 2 - create a Preloader movie and load the whole .swf into it.
only problem is i need some variables that i pass to the movie via QueryString parameters in the Object and embed tags. Is there any way to get this in my loaded movie?
i have tried
root.loaderInfo.parameters
and
stage.loaderInfo.parameters
and
parent.loaderInfo.parameters
none of them work. Can i create a variable in the prelaoder and just go "parent.thevariable" ? or does parent even work when something is loaded into a loader?
View 1 Replies
Jan 19, 2005
just wondering if theres a way to pass variables to a duplicated movie.Ill be creating duplicate movies very fast (about 20 per second)and want them each to have differrent variables to work with.duplicating with that , and i want to pass 3 variables to the new movie clipdot.duplicateMovieClip("dot"+currdot, this.getNextHighestDepth(), {_x: xpos, _y:ypos});
View 3 Replies
May 18, 2003
some variables are inside of a movie clip, and i can't seem to access them from the main timeline.
View 5 Replies