I've created a frame-by-frame (180 PNG's) rendered animation, put those PNG's into a .fla and created myself a nice "little" (8MB) .swf animation. The idea is that I can manipulate the timeline of this animation through the position of my mouse pointer; position of pointer on the left side of the stage means that the animation will play backward, position the pointer in the middle, the animation stops and when you position the pointer on the right side of the stage, the animation plays forward (as regular). The animation is looped, so it will go on indefinitely.
Now, this all works, except for the occasional hiccup. The animation seems to run smoothly but every now and then it glitches a frame or two. This really damages the experience and beauty of the concept I'm trying to establish. I've added a small fps/ms counter and it indeed shows a drop in frame-rate and a peak in the ms every now and then. This is not consistently happening on a single frame or anything, it seems rather random.
current method;
Code:
// used in the enter frame event
_animation.gotoAndStop(_animation.currentFrame + 1);
This seemed to be working the best so far (the least number of glitches). Perhaps it is a bit blunt?
previous methods;
- I've tried to 'tween' the animation by creating a tween (using greensock's TimeLineLite) and either 'play' the tween or 'reverse' the tween (according to the mouses position). This seemed to work properly, but I could not find a way to loop the tween both forward as well as backwards. The tween would loop indefinitely forwards, but when 'reversing' the tween, it would stop after the number of forward loops it had made. So if the animation made three whole loops forward, it would stop after three loops backward.
- I've tried to 'tween' the frames of the animation using greesock's tweenLite;
Code:
TweenLite.to(_animation, 1, {frame:_animation.currentFrame + 1, useFrames:true});
// or something in that order, can't remember.
Something like that, it worked, but it was glitchy as hell (obviously).
Essentially, i have loaded an external SWF (area-home.swf) w/in a MC (mc_loader) of the main SWF (base.swf). This is simple, not a problem, works like a charm. What I want to do from here is have the main SWF (base.swf) tell the external SWF (area-home.swf) to gotoAndStop at a certain frame (42). Below is the code that I have, and can't quite figure out why it won't work:
PHP Code:
var loader1:Loader=new Loader(); loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, myFunction); loader1.load(new URLRequest("area-home.swf"));
[code]...
When i trace the total frames, it does bring back the actual frame count from area-home.swf, so I know that it is communicating. It simply does not stop on the 42nd frame (even have a stop(); command on that frame in area-home.swf's timeline)
i have loaded an external SWF (area-home.swf) w/in a MC (mc_loader) of the main SWF (base.swf). This is simple, not a problem, works like a charm. What I want to do from here is have the main SWF (base.swf) tell the external SWF (area-home.swf) to gotoAndStop at a certain frame (42). Below is the code that I have, and can't quite figure out why it won't work:
PHP Code:
var loader1:Loader=new Loader(); loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, myFunction); loader1.load(new URLRequest("area-home.swf"));
[Code]....
When i trace the total frames, it does bring back the actual frame count from area-home.swf, so I know that it is communicating. It simply does not stop on the 42nd frame (even have a stop(); command on that frame in area-home.swf's timeline)
I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:
for (var i:int=0; i < numChildren; i++) { trace(getChildAt(i).name)} (and get: instance1, instance2, etc.)
How do I record the instance into my external class? Something like:
(very rough example) var bar1:Object = getChildAt(i); var bar2:Object = getChildAt(i + 1); etc, etc
I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:[code]
I drew up some graphic symbols in Illustrator and imported and defined them as MovieClips in the Flash library. That way I could just place them where I want to visually on the stage. As I have been solidifying the visual design, I have been implementing it in Actionscript to access the flexibility the code provides.
In order to port a symbol to actionscript I did the following:
This should hopefully just be a quickie. I'm slowly starting to learn Flash and Actionscript and right now I'm a bit more stuck than usual. I have an array, "container", to which new movieclips are added by clicking a button. When they are added they are given a name, "pic" + i, and are added at the corresponding index "i". Now, what if I want to change the position of a certain movieclip in the array or alter its alpha value? I tried something like:
Any open source programs or any other software that can create isometric buildings that are compatible with flash (i.e. being able to manipulate the individual layers like that of an imported Adobe Illustrator file)?
Here is the problem I have: after I change the index of one movieclip using this code
oldIndex=getChildIndex(DisplayObject(e.target)); setChildIndex(DisplayObject(e.target), numChildren - 1); when I give the object its old index setChildIndex(DisplayObject(e.target), oldIndex);
and go to another frame of the movie, this element I have changed the index of stays on top of all elements on the new frame. My question is am I doing something wrong and if not, what can I do so that this element stays only in the frame it is placed.
I've having huge problems trying to control a internal SWF from my main movie.Here is how it works,main movie (loads swf1 and swf2)I need to make the button on SWF control de swf2 timeline.
Currently one of our teams suffers from a very strange phenomena: after manipulating the z property of a MovieClip and changing the stage quality some event listeners of nested MovieClips seem to disappear (or at least not react to the proper events any longer).
The problem also only appears when doing both, changing the stage quality and manipulating the zproperty.
can a movie clip which is loaded from an external source control the main timeline? For example I have a set of buttons contained within a movie clip which is loaded externally onto my main timeline...can those buttons direct the swf to a specific frame on the main timeline? Also...is there any way to load an external movie clip into a specific LAYER rather than Level?
I've tried looking everywhere for this answer, but I'm still at a loss. I'm beginning to think it's not possible or I'm just not looking in the right places.I have three swf files. The main container and then two external swf files being loaded into the main swf. Swf 1 (frame.swf) has a function on the main timeline that needs to be called from a button in swf 2 (toolbox.swf). My initial thought was to place the actionscript of frame.swf into a movieclip and call it from toolbox.swf using:_root.callFunction("PH", "doPhone");Although this would work, I cannot use this option. The actionscript of swf 1 must stay in the main timeline. Using a class file is not an option either. Is there any other way to call a function from the main timeline of an external swf?
Is there a way to conrtol the flash timeline with an external html file? For example, if i loaded in a textfield formatted as html, can i get the <a> tags to , (...say) _root.gotoAndPlay (33)
I have just started using external AS3 files to try wean myself off using code in the main time line.I am importing an XML file using an external as3 file, but cant return the values to the main timelineIt worked when I used the trace option, but I need these values to dynamicly populate a movieclip on stage (another problem I cant add movie clip to stage even though I have the linkage etc)AS3 Code ----------------------------------
So I have a simple as3 project i'm creating in FlashDevlop and I was hoping to create the layout as a simple swf thats loaded in then move the assets where they need to go. Things like roll over states would be stored on different frames to make it nice and easy for designers so they don't have to know flash. And loading it is no problem but how do you target the movie clips inside it or how do you even attach it to the root? When I say target I mean as in how would I target it to change say the height or width. I know this is broad question so even pointers to a good FAQ or example project would be helpful. I spent a little time on google but all im finding is how to load a SWF not how to deal with it afterwards.
How do you address a mc attached to another mc?I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.[code]How do I now manipulate the "ExtraMC" movie clips? I know I can use parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?
I have a menu with 5 menu items that when an item is selected, the non-selected items need to be moved. All are movie clips. When user selects item 1, the remaining items will slide underneath item 1. I want to make a custom function so as to alleviate unnecessary code. I am moving the MC's with tween class.
I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.
ie.
for (i=0;i<BasicMCArray.length;i++) { _root.BasicMCArray[i].attachMovie("myExtraMc","ExtraMC" + i,depth++); }
How do I now manipulate the "ExtraMC" movie clips? I know I can use _parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?
I have a problem when making flash applications with more than one frame that has symbols placed on it in that I can't declare all of the event listeners for the objects at the same time and I have found that even if I put them all on the first frame, add the event listeners, then click through to the next frame then the buttons won't work on that frame.
Does anyone have any idea how I could solve this? I did consider myself a fairly competent AS3 programmer until I realised I had no idea how to handle this sort of thing. Solved: I initialised the clips from my external class and then addChild'd and removeChild'd them as I needed to and placed their x and y on addChilding.
i have a photography website, the main 'index.swf' file has two scenes, one for the loader and one with the content.i have a navigation menu:item 1, item 2, item 3, and so on. i have 10 layers, my nav menu is on layer 10, at the very top.i also have a a layer for each one of my navigation menu content. Now i click on item 2, and i load a external movie clip called "fotos_mc" on to the stage and inside this movie clipe i load pic1.swf using: loadMovie ("pic1. swf", 1);it loads fine, except that it loads on top of my navigation menu, logo and so on, even it's on a layer that's under the layer where i have placed my menu and logo. is there a way that i have load my movie so that it displays behind my menue?
Okay, so I am filling a TileList component with custom "ChordUnit" MovieClip objects, each of which is associate to a ChordUnit ClassI've established a way of determining if any of these objects are being moused over or clicked:
public function setChordBinSong(song:int, extend:Boolean):void { dpChords = new DataProvider(); for (var i=0; i < activeChords.length; i++) {
I want to dynamicly add images from XML to movieClips and then add event listeners to these movieClips. What is the best solution? XMl loads correctly, it also add 2 movieclips on stage, but it throws errors when I try to add event listeners to movieClips. How could I do that? I want to go to different frames on release of some movieClips. How can I please recognise each movieClip and manipulate with that movieClip ? (resizing,...)
I have a rather unusual problem. I've got an Array consisting of ten different MovieClips (all pre-placed on the stage), and would like to be able to manually use the gotoAndStop and gotoandPlay commands on these via the array. I've tried ActionScript Code: //This script does not work IconArray[1].gotoAndStop(1); however it simply throws out an error. Is such precise manipulation of MovieClip arrays even possible, and if so, how would I code it? (Nb: I've looked at the ForEach method, but couldn't find a way to make it sit my current dilema).
I am working with a site that's similar to : [URL]. When you click on Wedding Site and then go to the gallery, you will see the pics loading full screen and the navigation bar on top of the pics. What I have done is I have made each one of this pics a separate .swf file so they load individually once they are called using the " loadMovie("pic1.swf") code line. On layer 10 (being at the very top) I have my menu so it will always display on top of anything else. Now on layer 3, frame x I have a movieclip called : fotos_mc, inside this fotos_mc on layer 1, frame 1 I call the swf using the code above: "loadMovie(pic1,swf"); However when the picture loads, it covers the full screen on top of my navigation menu, on top of my logo etc. Which I dont understand why if the layer where I have placed my fotos_mc is under layer 10 which contains my menu and my logo.
I have a list of external movies. I want to import them only once and then use them as many times as I want. I need to attach them to other clips the same way I would attach them if they were in my current library with linkage option on.suppose i have a movie called s1.swf in the same location with my movie. then I have this code:
Code:
function createObj(objname, whichMc, level) { _root.createEmptyMovieClip(objname, level); _root[objname].createEmptyMovieClip("mc", 1);
[code]...
I don't know why the event handler for the movie "mc" is not invoked ... I have no trace record in the outpus window.
The main fla file loads an external swf file that is a movie clip that has the card art images (one card art on each frame)
This works good and I can view the loaded swf on the stage.
public function FinishedLoading(loadEvent:Event):void { LoadedMovie = MovieClip(loadEvent.currentTarget.content); addChild(LoadedMovie); }
What I want to do in another function is to duplicate the load swf, so that I can have 52 of the same object, each with a different picture. I need to know how to create an instance of the loaded swf.
I would like to control each instance of the loaded swf by telling each one independently of each other to go to and stop at a specific frame such as 3 or 17, or 43, based on what card is needed at that time.
I have an mc with the variable called "Section" and I want to be able to change the contents of this variable from another MC. I have tried MovieClip(parent).mcInstanceName.variable = "normal"; But that doesn't work.
i retrieve a list of instances located in a array to manipulate them in a variable holder. Normally, the operations can be made between two instances stored in a simple variable to variable fashion and it works realy fast.I analysed two main operations: retrieving references in a array to a variable and get or set a value from the variable reference.Here are the objects used to perform the test operation:
var v4:Vector.<Person>= new Vector.<Person>();//List of Persons instance var refHolder:Person; //Typed referencevar refHolder2:*; //Not typed reference Test #1: looping 200 000 times and only retrieving references from the array v4.[code]........
So my conclusion with that test is that with a typed reference you spend more time assigning a reference than manipulating a value from the reference With a not typed reference, the time spent is in manipulating the reference in the variable.Which one should i use or what should i do to have better performance with manipulating references from arrays?
Here are the files i used to test this: reference.swf //Online example reference.zip //Source file