ActionScript 2.0 :: Loading XML Data After OnClipEvent
Mar 1, 2010
I'm trying to load XML data after an hitTest but doesn't work the way I'm programming. Here is the source code:
onClipEvent (enterFrame) {
if (_root.ster1_mc.hitTest(_root.rocket)) {
trace("raak");
function loadXML(loaded) {
[Code] .....
When I use the XML code simple on a button it works perfect but after my hitTest it's doing nothing... When I remove the function it say's undivined in the textarea.
I have a Movie Clip on my time line that has an empty movieclip inside it which I whish to load a random external SWF file into. There is to be an unknown number of SWF's to load in and these are to be played one after the other. So when the first random SWF is finished playing the next random SWF is to start playing.
Here is the hierarchy of my file
Code:
|_ Timeline |_ plasmaScreen_mc |_ emptyMovieClip (instance name advert)
So on my empty movie clip I have an onClipEvent which loads in the file path of the External SWF from an XML file and tries to load the extrernal file. Here is my code
Unfortunately because the code for getting data from the XML file is included in the onClipEvent "this" now refers to the XML data and not the movieclip. Can anyone tell me how I can proceed. I need to pass the filename to movieclip.
It's a very basic comments form with only 3 fields, the information gets sent directly to a email address through PHP.
The form works perfectly, sends all the information to my email, but my problem comes in when I try to run a onClipEvent(data) handler to go to a "Thank you" page when the information's been sent.
The onClipEvent(data) handler runs on the form movie clip and works fine when I run it on my local drive, but when I run it through the website it never executes. The form just get sent and it stays on the same frame.
I'm getting headaches from this because it looks like all the codes are working fine, it just doesn't want to run the damn handler!
I'm having an odd issue with this onClipEvent friend... In the main timeline, I set a variable like so:
[Code]...
And when it occurs, I get back LOADING FLAG IS: true, and that's fine too. Then, on the object I have the image loading into, I have the following:
[Code]...
And indeed, when the image loads, I get the trace statements, BUT though it traces, it does not redefine loadingFlag! also, the second trace statement comes up as IMAGE LOADING FLAG IS: with no value afterwards... Is there something with onClipEvent(data) where even though it's attached to a nested movieclip, it doesn't refer to the _root?
I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.
The probem is I have an external swf file that loads a mailer. everything works fine apart from the fact that when the data is sent to the php file this command wont respond. It works on my local but once on the server it dont go.I think that the problem might be that MC (goin) is the MC that this code is located in?
How would you write this into a function that lies on frame 1: onClipEvent(data){ this.sendSent.text = "MESSAGE WAS SENT"; this.textEmail.text = "EMAIL"; this.textSubject.text = "SUBJECT"; this.textName.text = "NAME"; this.textMessage.text = "MESSAGE"; }
I am trying to change the images the following calls up. (Using CS4 and AS 2.0)[code]Where is the getCurrentImageName calling the image up from? or..Where is the imageProperties.link ToOpen pointing to?Honestly, I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.I'm probably one of those girls that knows enough to cause more damage than good, so at least point me in the right direction.
I'm using the code contains onClipEvent(load) and onClipEvent(enterFrame) and duplicateMovieClip() to make the snowing effect in the 2 first movie-clips but then, i cannot stop them in the next movie-clips. (All of my movie-clips in 1 scene only.)
I developing a site where on the homepage, there are about 6 images that rotate, but if you click on a sub link, a different image loads. But the problem is that, the first image has to cycle through before the second image loads. I want the second image to load immediately.
I am attempting to get data from an xml file load in flash. I followed a tutorial in a new fla and it seemed to work fine, I then tried to adapt it to my own needs which worked fine. But then when trying to implement this into my news section it doesn't seem to work. I am trying to make a news section, that displays the date and news article. This is in within a movie clip, I even tried putting it in the timeline of the scene but still nothing.
- I have 2 dynamic text boxes, date_txt and news_txt
- The xml file is named news.xml,
- both the fla and the xml are in the same folder
This is the actionscript I am using:
function loadXML(loaded) { if (loaded) { _root.thedate =
I have 2 images that I want to swap places on a certain frame in my animation. I've been messing with it for quite sometime now and I can accomplish one of two things. Either the animation goes smoothly and the images don't swap depths or the images swap depths and the animation hangs.
I have a file where user chooses xy cordinates which display in text box.... which is workin, but I want to have it only appear inside a box area? ie choose once only inside box area - once outside i want the mouse to behave as normal (no new pointer no xy tracking) not sure what if statement would work ?
onClipEvent (mouseDown) { duplicateMovieClip("../cue", "cue" add n, n); setProperty("../cue" add n, _x, getProperty("_level0",_xmouse));
This is my AS code: onClipEvent (enterFrame) { this._x = Math.random()*2+90; this._y = Math.random()*2+60; this._alpha = Math.random()*30+50; } It is applied to the movie clip. I am having trouble figuring out how to STOP to action. I want it to stop after 10 seconds. How do I do this?
I am just learning Flash. I'm using Flash CS4, However I am using Actionscript 1.0/2.0. I have a main page with just simple buttons, and such. My question is, I need to load a swf within my main page. I have a sqaure in the center of my page that I want to load a swf in. I made a rectangle using the rectangle tool, and converted the rectangle into a symbol so that actions may be placed within it. I want to load a file called News.swf within the rectangle. I can't find any code to do this that doesnt have compiler errors.
I found one code: News.loadMovie("News.swf"); when I put just that in the Actions field, and I export the movie I get the error: Statement must appear within on/onClipEvent handler
I just want to load News.swf in the actions tab within a symbol.
I have two movieclips that determine their frame number by a variable. The problem I'm having, though, is that the frame doesn't change when the variable changes. The original variables are determined in the main timeline (_root.item_slot1= 0;).The following code is contained in the item_slot1 movieClip:[code]So it starts off in frame 1. If I change the original variable to 1, then it will go to frame 2. However, the frame doesn't change when the variable changes, and I have a text box that shows the value of the variable, and it changes to 1 exactly when it's supposed to.I can't zip files, but I have the .fla at URL... if you can get it to download from there.
I am using loadmovie to load a separate .swf file into a movie clip which is on my main file time line. Is there anyway I can use Onclipevent () to preload the movie I am loading in?
I want to duplicate an MC every 5th second, so I came up with this code:
Code: i = 100; p = 0; onClipEvent(enterFrame){
[Code].....
I know this doesn't work, because onClipEvent only works on buttons or MCs. So the question is: is there an onTimelineEvent or something that'd work on the timeline?
i remember there is a actionscript tat u can set on the timeline instead on the movieclip itself - onClipEvent(enterFrame){} what the code for it for the timeline.
1. If I have a 'fish' drawing, and I want to produce bubbles at its mouth, how will I know where its mouth is through Actionscript?
In general, if I have a complex drawing and I want to identify a single part how do I do that using actionscript? This complex object could be an octopus. Then, how do I locate the arm number 3(an octopus has 8 arms?) of the octopus?
2.How do I exit from onClipEvent() when a condition is met? For eg, in VB I have the exit function but there is no EXIT function in flash 5 from which I can exit whenever a condition is met?
why it isn't working, or what I'm doing wrong to fix it. maybe I have the right script, but the wrong location. I'm also on Flash 8, by the way.example. I have the movie clip labeled "characters" on the main timeline. in that movie clip I have one movie clip titled "boy" and another one titled "girl". the "boy" movie clip is lip-synced and talking up a storm with some audio, and somewhere down the line, "girl" movie clip is introduced and is also supposed to speak on the frame I labeled by the same name, "speak". I'm trying to specifically target a certain frame in her movie clip timeline to play, but I just can't get it right.what I do have is:
I've tried placing the script directly on the "girl" movieclip when I want the event to happen, and then also placed the script on its own actionscript layer, but somehow, it just isn't working correctly.like I said, "boy" is chatting up a storm, and let's say something like frame 200 is when I want "girl" to come in with her line, that specific audio frame within her movieclip timeline labeled, "speak". she also has about 6 other speaking cues that I'm trying to call up to coincide with movieclip "boy" while he talks.