Combining The OnEnterFrame Functions?
Sep 8, 2011i have a few onEnterFrame functions like 6 to 7 which I want to combine them into a single function. But it doesn't work after adding the function.
View 4 Repliesi have a few onEnterFrame functions like 6 to 7 which I want to combine them into a single function. But it doesn't work after adding the function.
View 4 Replieshow to cimbine the prototype with onEnterFrame. I'd like to fade in some objects like this:
[AS]
mc._alpha = 0
onEnterFrame = function () {
if (mc._alpha<101) {
[Code]....
or can it be done without onEnterframe with an interval or something like that?
In a game in which a player must pass through one of three different colored doors , each of the doors on the stage is a different instance of the same symbol. The symbol contains three frames labeled "door1", "door2" and "door3". I am attempting to get the doors to be randomly generated. The following code seems to work correctly when I trace it:
function getNewDoor(min:Number, max:number):Number
{
var getNewDoor:Number = Math.round(Math.random() [code].........
I want to create a photo album. I have 8 thumbnails (thumb_01, thumb_02 etc)I want, when the photo album opens up, the thumbnails to appear with a Interval of .7 seconds and to rescale them from width and height 0, to width and height 80, with an elastic movement at the end ( maybe that they get a little bigger before they reach their final width and height. I have the following functions:
for setInterval:
Code:
function showClips() {
if (clips.length) {
clips[0]._visible = true;
[code]....
My problem is this: I miss the elastic movement in the scale function and I really don't know how to combine these two functions.
I have these images that will load when I input a certain string of text but I don't know how to combine functions to make a generic one that will work for all of the images. These are just two and they're basically the same thing except I have to make each function (something)1 and then (something)2 for the next image.
[Code]...
How can I combine these two functions without any of them failing or interrupting each other.
[Code]...
onEnterFrame=null, onEnterFrame=undefined & delete onEnterFrame....
Which one to use??? What are the performance considerations. If all my movieclips on-stage are running a MovieClip.prototype.onEnterFrame = function() {run initial stuff before setting onEnterFrame=null/undefined... }, will there be performance hits? It's sad that delete onEnterFrame doesn't work unless I delete the prototype enterFrame as well, which would make the clips reinitailise itself again once you declare the enterFrame prototype again (i need to do this since there's more movieclips that end up appearing on-stage, and they need to automatically initialises themselves the moment they appear).
[Code]...
I've been trying to run some functions in my class every frame and have come up with this code:
[Code]....
I get no errors, but the functions charactercamX and charactercamY are not running every frame.
i'm very new to Flash (although have plenty of experience in Java, C++, PHP, etc). For a University assignment, I am creating a World Cup Guide and i'm creating a countdown to the tournament. I've followed a tutorial and modified it slightly but i'm receiving an error message. The error message is:
[Code]....
any consise methods to restart a deleted onEnterFrame that has been deleted?
View 3 RepliesI'm making a website which consists of an intro and the main page. For all intensive purposes, let's just call em intro.fla and main.fla.I would like to combine the two somehow
1) Turn the entire intro.fla into a movieclip and place it at the beginning of main.fla PROBLEM: main.fla is substantially larger, and will bump up the load time for the intro.
2) Run the intro, and have it load the main page with a UILoader.PROBLEM: The intro doesn't Unload, causing problems with the main page. How can I unload the intro.swf from it's self?
3) Somehow combine both .fla's before I convert to a .swf. I think that I could eventually figure out how to make it work properly, but I'd rather someone tell me what the preferred method is and why.
I have three different fla/swf files, and I wish to compile them into one fla/swf for easy viewing.The problem is that they each have a different frame rate.
View 2 RepliesSo here's what I want to do: I have a button, and I'm adding an Event Listener to that button to call a function. Now I want the event to be triggers when someone mouses out of the button AND someone is mousing out in the direction up.
-carbotech_button.addEventListener(MouseEvent.MOUSE_OUT, callLink); <--- does the job for Mouse Out
-carbotech_button.addEventListener(MouseEvent.MOUSE_UP, callLink); <---- does the job for when the mouse is moving up
So I need to make it so that both of these end up true in order for function callLink to be called. Is that possible, and if so, what would the syntax be?
I tried to combine two of Tony's great tuts.URL...I'm not sure what I did wrong so if you guys could have a crack at these and try to combine these.
View 2 RepliesUsing AS3 code, is it possible to combine 2 graphics or more into one?
Example : combining a rectangle and a triangle to make a nice arrow?
I have tried on google with no luck so before I spend anymore time on this would like to know if it's possible.I have 50ish very small 1 - 2 second swf files each one is like one slide. I would like to combine them all together into one flash file.Is this possible, as a note I don't have the original source files I have just been provided with the swf files.
View 3 Replies1) I started off with one FLA that was scripted so the mouse controlled panning (horizontal and vertical). That works fine by itself. (image_panning_as3.fla)
2) I also have another FLA that was scripted so when you click the buttons a popup window will come in and play any SWF content. (test.fla)
I have tried to combine these files multiples ways. Putting #2 into a movieclip and #1 outside the movieclip. Tried to rewrite everything together with no luck. I am trying to do is combine the AS3 into one FLA (except for the main.as) or basically get the AS3 in #1 to go into #2 and have everything work (Pan around screen with mouse and buttons still activate popup).
I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.
[Code]...
I've got a project thats getting a bit big, so Im taking the actionscript out into separate as files. I want all the basic functions to be in BasicFunctions.as and the make a library for more specific functions. I find that a lot of people use the import statement but I cant get that to work with a simple Hello World trace, yet the include statement works fine (see attached). I understand that import/include work differently, but which is the better method? If import, then is that heavier to work with. Any rate, what's the best way to organise code when it gets to the 1000+ lines?
[Code]....
I created several SWF files, now i want them to interact with each other So there is main SWF file lets call it: main.swf then within that file(main.swf) I would like to create buttons which will be calling other swf files for instance by pressing one button one.swf will be open by pressing other button two.swf will be open and so on. Then I would like to create buttons within one.swf and two.swf which will allowed to go back to main.swf.
View 3 Repliesi have the following code:
seatContainer.getChildAt(order.seats[i])
i want to add a child to this but it doesnt allow me, i can only add an eventListener to this.
how i can add a child to this without using an eventListener?
I am very new to AS and I'm just starting to grasp the essentials of how things are working... but I haven't got to the point to where I can write my own from scratch, so I kind of have to "Frankenstein" different examples into a working project. I found a great XML slideshow demo that I want to overlay with a masking effect, but I'm having some difficulty combining the techniques.
At the bottom is my original slideshow code. If there's anyone that can modify my code or at least guide me to what I need to do to make it work,
[Code]...
combine the following from Senoculars classes:
Transform.as - transform handles to rotate an mc
DashedLine.as - to draw a dashed line
ProgressiveDrawing.as - to move an mc from a - b
(Links at bottom)
I am basically trying to drag a mc onto stage. Rotate it using rotation handles, move it to another position and rotate it again. Then press play to watch it move from a - b, with a dashed line, and rotating from a - b.
Has anyone done this before or know of examples?
Senocular has combined DashedLine and ProgressiveDrawing in this example: [URL] and its been really great but now I am stuck trying to make the mc rotate. I have made my own crappy rotation handles but thought it may be better to use the transform (and convert somehow to as2) and store each rotation.
[URL]
I have two movies. The first one has a button that, when clicked on, loads the second movie using loadMovieNum. I'm want to be able to jump to a specific frame (i.e. 177) in the second movie when I click the button in the first movie. I'm using the script below to load the second movie: But it don't really work.
[Code]....
I've successfully loaded my xml and created three arrays to hold the news article date, title and text, using the following code:
HTML Code:
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
[code]....
How do I firstly get my arrays into a textfield with the format date,<br> title,<br> story, and secondly how do I deal with that horrible datestamp to make a recognisable uk date?
How do i store the information from two seperate arrays in to a new array?
View 2 RepliesI just want to combine two objects and their properties together.
For instance if I have...
Code:
var appleObj:Object = new Object();
appleObj.type = "apple";
var orangeObj:Object = new Object();
[Code].....
I know there is a way to do what I am about to ask I just can't remember how.
The problem: combining onRelease or onRollOut in a single function.
It goes something like this:
button.onRelease , button.onRollOut = function() {
// do whatever
}
1. I'm wondering if there is a way to use the loader to load in a series of pictures from disk rather than URL. If so what is the code for this?2. Is there a way to combine variables to create one single variable. Again if so how can I do this?I have included the code I am working on to give some clarity on what I'm trying to do.
Code:
var h:String = "http://img163.imageshack.us/img163/5961/pngjoust";
var p:String = ".png"
[code]......
So, I need to make a slideshow that displays an arrow button on either side that can allow a user to navigate between four different swf files. The only specification is that the swf slide out as the new one appears. Could I do this in AS, or would I need some type of plugin?
I'm pretty sure I can make an empty movieclip and just load the SWF into it, but could I make the previous swf slide out as the new one appeared by doing that?