ActionScript 2.0 :: [MX04] Store A Mc's X-position Between Scenes?
Feb 13, 2009
I make making a basic animation / game. Basically I need to have a movieclip named "ground" stay in the same position between scenes. It will be moving around and at certain moments, the movie goes to other scenes and it needs to place the ground at the x-postion where it was last at. So I had:
I set a variable (xpos) to be 0 earlier and then i have:
I have a AS2 netstream instance, in which I am loading various flv's into. The 'main' video has links to other visble when its playing. I want to be able to store the position of the flv (in seconds) so that when the user comes back to the 'main' video it remembers where it was and contiues to play. This is the code I have written so far regarding this (its probably massively wrong).
I have several buttons, that link to several scenes, containing swf files. Using the loadmovie command I can get these swf's playing on-screen. That's good.
-How can I control where they appear on my document (I'd guess these require some x or y values, but not sure how this is done) as they all appear in the top left-hand corner. - When I mouse over another button (link to scene/swf) how can I remove the previous swf from the page, then load the new swf -as they all appear in the same spot/all over each other? Is this an unload movie command?
I was hoping to counter this problem by using different scenes (no luck there) and all I really need to do is remove the previously loaded swf, when the new one is loaded.
I`ve run in a bit of a problem. I`m trying to make a web player in AS2. It stores some data from player for later usage in a shared object. One of the things i`d like to store is my current playing position, so player can start of where it was playing after page reloads, but i can`t think of how it should be done..
I'm trying to store the initial X position of five movieClips in an Array by looping through it. Should be no worries, but I only end up with "Undefined" when I trace the array afterwards...
whenever I set my sound to stream and continue to make a movie with multiple scenes. The audio and video get disgustingly out of sync sometimes even off by 30 seconds. I just started an animation its only 10 seconds long with two scenes and the AV is already off by about 5 seconds. Ive worked around this by avoiding scenes altogether but i really don't want to have another 5000 frame scene. I discovered this problem in Flash MX and Im quite annoyed that it still has't been fixed 3 years later!
I have an interactive story divided into scenes. At the end of each scene a button appears. This occurs on a frame on the timeline.
There are two different buttons that might appear based on whether a prior scene has been viewed or not.
For example, there are Scene_1 and Scene_2. At the end of Scene_2 one of two buttons will appear. The buttons will be either "Go see Scene_1" or "Return to Main Menu".
If the user has already seen Scene_1, Flash will know that and automatically go to the frame in Scene_2 that contains the button "Return to Main Menu".
Conversely, if the user has not seen Scene_1, Flash will know and automatically go to the frame in Scene_2 that contains the button "Go see Scene_1".
I imagine there would be an action frame at the end of Scene_2 that will contain the as2 code to enable this action.
Perhaps something like, but probably not at all like the following:
if ("Scene_1", last frame == true){gotoAndPlay("frame#");}else{gotoAndPlay("frame#");}
I am working with a project that has many scenes. Each scene has a movie clip attached to it. The first scene is simple...just a couple of buttons and that is it. My worry is that when I add all of the videos that correspond with each button and publish the SWF will be a huge file. THE QUESTION: Does flash load ALL scenes of a movie or does it load the first scene and then load the other scenes when the user needs to view them?
My ultimate goal is to just have the first scene load and then when the user clicks on the buttons contained within that scene that only upon release does the corresponding scene load. Maybe I am doing this completely wrong and should look at doing it another way.
I am not exactly new to Flash in that I can do several things with it. However, I am not anywhere near expert status. I am working on an interactive map of a college campus for my employer. I am employing buttons that, when moused over, display a large image of each campus building. The question is this: is there a way to also have maybe an actionscript that would center that image automatically?
In other words, if the building I want to show is on the right hand side of an internet explorer window and I mouse over it, is there a way to have the map auto scroll the window to center the image that pops up on mouse over?
I have been asked to loop an existing FLV file that someone else created. I do not know what version of Flash was used to create this file, however I do have an older version 7.2 Flash MX Pro. Currently the FLV starts automatically and stops and the end of the movie. The owner of the site would like the movie to start over with a continuous loop. I'm pretty much of a rookie with Flash and with HTML5 coming out soon, I don't think I'll get a chance to become a pro at this.
How come every time I run this script:[code]Where does the Undefined come into things? I have only asked the script to fire 3 times so the first time through the text in position [0] in the script Carp should be printed out?
basically what im trying to do is have a basic countup timer that goes in intervals of three. (3,6,9,12,15,ETC.) but it has to run with a 12 fps and not stop. also this cannot be 1000 frames long .
Im trying to make a preloader. this is my first attempt and from a tutorial and some minor adjustments on my part this is what ive come up with. i was wondering if there was a way to add a percent, and also why this doesnt disapear after its done loading. it remains on the stage throughout the loaded swf.
my flash tutor is on vacation and I need to work on a project. How do I move an action from from 246 to 271?? I've tried Copy/Paste and it's not working.
I've put a blur effect on the hit state of a button, but the script for the button is On Release Go to and Play the scene I wan't it to skip to. So as soon as the button is clicked it does what it's told and the blur effect (16 frames long) doesn't get to play.
On to the problem: I have a very simple flash, basically just a photo slideshow. The issue I'm having is this: I have a bunch of photos on the timeline, but I have a button on top of everything, just to give viewers the option to skip that particular scene. The button works, but only when the video timeline has reached the very end of the scene. It won't work before the end of the scene. The button actionscript is the most basic of basic:
Anyone know a good tut on how to implement the JMEvents calendar component? It comes with MX04 but I am unable to find a tut at the moment (although as I type I am looking and trying to work through it). It can be either an xml, db, or hard coded example. Just need a little push.
I'm having a buch of pictures of different height and width, which have to be loaded into different movieclips, and resized to 'bout 100px * 100px (so they're all the same size ~> thumbnails)
The problem width xscale and yscale, is that you have to specify the amount the movieclip/image resizes, in percentages instead of in pixels.
is there ANY way you can resize a dynamically loaded JPEG to EXACTLY 100*100 pixels ?
ok I have 2 buttons, and they load external swfs into containers everything works fine but it seems like my gotoAndPlay("framelabel") isn't working...
here is the code for the buttons... incidentally they are inside a movieclip on the mainstage... everything else seems to work just fine... also I have my intro and out animations inside the external swfs. I've tried _root.contents_mc.gotoAndPlay("out"); I've tried _parent this._parent and _parent._parent and this.contents_mc.
both buttons will load the external swf but when I click on the other button it should play the out and then load the next swf and start playing the intro (which is the beinging of the external swfs timeline) ANY Ideas whats going on here?
That was supposed to be my first preloader dealing with an XML file and external jpgs ... searched the forum, found something that looked/sounded like it would work, tried to adapt it to my particular situation and ... (surprise!) ... it doesn't work. Let me add at this point that I'd consider myself a "very casual" ActionScripter (if there is such a thing), meaning that most of the time, I try to learn as I go along, without any *real* background knowledge. Here's my situation - methinks it's rather straightforward: SWF file (project.swf), XML file (config.xml) and a bunch of jpgs all in the same directory - nothing exotic so far. Here's the AS I (try to) use in my SWF file to load the xml and the imgs therein:
I'm having trouble trying to link a .swf using xml to open up an html link that is on the cd that a user will have in their drive when running the swf.home.swf > goes to CD drive> open up about.html
example of xml: <linktype="sample" display="yes" ref="file:///d:/about.html">
I want the clips to be displayed in, for example, 2 rows of 3 clips, 6 in total.
By modding the AS to
total = 6; for (i=0; i<total; i++) { t = _root.createEmptyMovieClip("xml"+i, i); loadMovie("imgBack.jpg", "xml"+i);
[Code].....
I realise that the size of the jpg determines the point at which the second row is displayed so can I do it easily by determining that the third mc has been reached so start a new row?
I am doing up a photo gallery as a pet project using only actionscript. So far I have been successful in achieving the objectives that I want. However, moving forward, I intend to make the flash photo gallery easy to customise and want to add in a XML config file for flashh to reference.Here is where I am facing some problems. I managed to get Flash to read the XML data w/o a problem. The catch is how can I know when the XML file is loaded before I render the other movie objects (which require the settings in the config file)?
eg.
file_xml = new XML(); //Load XML file XML.prototype.ignoreWhite = true; //Parse the XML data
[code]....
Is there a way for Flash to listen to when I can start using the config values?
In my Flash, when you push a button, a symbol goes from having an alpha of 0 to an alpha of 100. When this symbol appears, I want it to begin animating on its first frame. However, I'm not quite sure how to do this. D: gotoAndPlay doesn't seem to be doin' the trick.
I've got an idea for a game I'm making that makes use of both mouse buttons, but the pesky right click menu always gets in the way. I've been doing some research, and I've heard tell of some "authorware" programs that disable the menu? I've also heard that disabling the right click menu voids some kind of warranty.
I just want the ball to bounce somewhere else other than stopping the ball at the place. I already made sure the paddle can move and the boundaries block the paddle from leaving the stage. So can someone give me the codes (please simple for me to copy-paste) for having me to bounce the ball some opposite direction or whatsoever. Like once the ball touches the paddle, it reflects somewhere else at the same speed and a different direction without any errors.
Can someone help me out and tell me how i can set the size of an external swf i have loaded into a target movieclip.ive got the external swf loading into the target ok but its too big.
I have a hitTest that is supposed to update the variable so the text of the score will go up one every time. But unfortunately, it works but it doesn't. It passes the number to the variable but the change doesn't appear until you enter the frame again. For example the money sign hits the piggy bank twice. the score will stay 0 but if you go back to the frame it will have a score of 2. How can I make it update live?Here is the code I have on the frame
Code: if (_root.money.hitTest(_root.pig)) { _global.score += 1; }