ActionScript 2.0 :: OnClipEvent To Populate A Field In A Pop Up?
May 24, 2010
i have a built a little interactive map for a client and have a series of movie clips contain contact details and email addresses when each city is clicked upon.I am using the mc tween prototype to alpha them in and out to make it look a bit more slick. The map_mc contains movie clips for each city (with an onClipEvent to populate a field in a pop up with the city name) which in turn contain an invisible button with (on) rollOver, (on)rollOut actions and (on)press actions for displaying the pop up and contact movie clips for each city.I have written a function that resets the email and web address buttons inside each contact movie clip (on)press which works fine:
[code]...
everything works perfectly apart from the lines in red. The enabled = true is simply not working. I have checked that the path is corrected by substituting _alpha = 30 and the email and web buttons
I have a sort of "presentation" that is divided into frames--each side is on one frame.I want this to be an interactive presentation, so I want the user to have the ability to click on certain underlined blanks, and it reveal the word that goes in that sentence. I also want to be able to populate these field by XML, that way I don't have to constantly keep creating movie clips with text boxes in them--I'd rather just use a few MCs.
There are also cases where there are 2 or 3 interactive words to be clicked on a screen. I've been struggling with the fact that XML doesn't like frames.
I would like to be able to dynamically populate a dynamictext field (assuming that's the best component to use) with anarray of data from PHP.I have attached my PHP code and my Flash Code.The PHP code is working fine and generating the array.The first part of the AS code is working as I can see thepop-up window with the PHP array in it. However, I can't figure outhow to get the array to display in the dynamic text box.I have created a dynamic text box in flash with nothing inthe 'instance name' box and 'events' in the var box.
I am using a gallery written in AS3.0 called SlicedCubeGallery. It used Flex to publish the gallery.I can edit the functions for the SlicedCubeGallery, and the one I am targeting is the one that swaps the images (which I have running on a timer).I am loading the whole gallery SWF onto my stage using this code:
var request:URLRequest = new URLRequest("slicedCubeGallery.swf"); cubeGallery_mc.load(request); addChild(cubeGallery_mc);
I have a detailed results page to which I want to post all the questions, answers, and whether the user answered correctly or incorrectly. All this information is stored in a multidimensional array and its successfully showing the results via the trace method.
My question is, what is the syntax for populating a dynamic text field with these results? Do I just write out one long line of AS with the newline command to separate the data? How would I go about applying bold to certain parts of the stored data that I will be showing?
Here is current code for my detailed results page:
function showResults(){ trace("Now showing results"); for(var i:Number = 0; i < NumberOfChallenges; i++){ //This calls the length of the original array (not the spliced copy)
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 m trying to populate a text field (modelT) with the text corisponding to the "data" part of the selectedItem in the combo box. The "data" shows up correctly when i use:
modelT.text = event.target.selectedItem.data;
But i'm trying to call it with a "if" statement (in red) so later on i can dynamically populate the text field from multiple combo box's. am i missing something simple, here is my code:
import fl.controls.ComboBox;import fl.data.DataProvider;import fl.managers.StyleManager; var cPurpose:Array = [code]..........
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 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 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.
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.
Simple really. This event handler tells 3 different movie clips to play forwards and backwards depending if the main movie clip has been rolled over. This all works fine... what I can't seem to work out is when the movie clip is clicked I would like this event to stop and become disabled.
I've got this on a movie clip instance and it works great:
[Code]...
What I want to do however, is have "music1" play earlier on in the movie. I have a specific frame that I want it to start playing on. I don't want to wait until this clip loads. I've tried just putting a keyframe on a frame within the main timeline and adding some script but, I can't make it work.
I have 5 image segments on a single PNG file. I am trying to get each of the 5 segments to "fly in" left and right and be revealed inside of a mask. It works, BUT only if I refer to a very old tutorial using onClipEvent, where the ActionScript is placed on the image's MC instance name (messy!). For some reason, I can only get this to work if I publish in Flash 6. Using ActionScript 2.0, I am trying to publish this as a version 8 SWF. Not sure what is deprecated, but onClipEvent seems suspect. I have tried (and failed) using onEnterFrame. The buttons no longer get that PNG to move left and right. It might be easier to see it, than explain what I have going on...