Placement Of Items On Stage Appears In Different Location On Webpage?
Sep 10, 2009
why when I place something on the stage it does not match up on the web page. Do I have to set the co-ordinates of the item for it to appear in the correct place on a web page.
I have an array with 8 items, and I want them to be randomly placed on the stage with each load, or when a "shuffle" button is pressed. Just a simple puzzle where the pieces are to be scrambled and then dragged and dropped by the user.Current code that isn't working:
Code: var myArray:Array = new Array(); myArray[0] = puzzle1;
I'm trying to find out how to set the placement on the stage for an external swf or flv.oh and i've tryed to loop an external flv with a listener object but i can't seem to get it to work.
what I'm trying to do is attach instances of a movieclip on stage, one by one, so they form a shape similar to one of examples below...(each dot would be a movieclip)I know I should do it using loops and probably sin/cos math methods, but am not sure where to even star
so i have a document class with added_to_stage handler, and when i get access to stage is there a difference between: having few movieclips on the stage ready for use, or pulling these same movieclips from the library? is there a reason why i should be pulling them from the library (and i dont mean multiple instances, just single item of each) when i can "leave" them on stage and get them directly?
I'm building an rss reader in flash. I have the rss displaying with no problem, the problem is, I need each title to open the web page to a particular site.The link is the same for every header, so I assumed it wouldn't be that hard, but since I'm very new Flash and followed a tutorial to get this working[code]...
It is a simple matter to place your object in a random place on the stage and not have it hanging over the edge, like so:[code]But for some reason I am having great difficulty coming up with a solution to how the random placement might work once the object has been rotated. and the registration point is no longer in the global upper-left corner. This might be easy if the rotation was a fixed # but I am rotating randomly along the whole spectrum.
i want that a MC appears randomly on the stage but with the time...like 1 second, and then after 1 second, it randomly appears somewhere else on the stage (800x600).
I'm drawing with Flash's brush tool and the marks I make are appearing not just where I draw them, but also in the timeline or elsewhere on the stage. It goes away if I minimize and restore, but this is a big time-waster.
I am wondering how to make the MC "bonus" appear at random times onto the stage and stay until the MC has stopped playing or it has been clicked on. I.e
- after 5 seconds, "bonus" appears on stage. - the 20 frames inside the MC play and then it disappears.
- A.fla includes buttons, movie clips and also B.swf is loaded in A.fla using a LOADER
- i want to access elements in A.fla, from the actionscript codes inside B.fla to modify those movie clips and buttons based on actions going on in B.swf
for instance, lets say there is a button X in A.fla, and there is a button Y in B.fla, B.swf is loaded into A.fla, and I want the button Y to erase button X when clicked.
general question: accessing elements in a stage, through a SWF file loaded into that stage.
Is there a way to detect when any particular movieclip appears on the stage's timeline in AS2?
Attempt #1: The MovieClip.prototype.onEnterFrame hack ---------------------------------------------------------
All Movieclips have an Enterframe event. I set it to attempt to delete itself within the function so it runs once. Unforunately, this isn't possible (delete this.onEnterFrame) doesn't work, unless we delete the prototype.onEnterFrame dierctly as well. Of course, we can set the enterFrame to null, but enterframe will still be called despite it being nulled. So, what are the performance hits as a result of this?
Is there a way to flush away the MovieClip.prototype.onEnterFrame (by deleting it: deleting MovieClip.prototype.onEnterFrame), and then re-declaring it again "MovieClip.prototype.onEnterFrame=someFunc", so that layter clips that appear on-stage can be initialised accordingly with the enterframe "frame1" function? Yes, but redeclaring the function again would also apply the same enterframe event to the previous clips on the stage which had alraedy been initialised, which would waste more cpu cycles. Unforatunelay, it seems the Prototype thingy affects all instances on the stage, not the constructor itself upon initialisation. So, doing MovieClip.prototype.onEnterFrame=something, will cause all Movieclips on the stage to have that event, which is going to suck!!!
Could i hack the MovieClip cosntructor and create a totoally new one? But i think all these are hardcoded alraedy.
I want the function to run only upon instantiation of the MovieClip when it appears on the Stage's timeline.
I have a button that, when it is clicked, should cause a text box to appear. I can make text appear as a trace so I know the button's working, but I have no idea how to either get the trace onto the stage - it only appears in the .fla .output window. I think what would be preferable would be to get a text box to appear as the event but can't work it out....
I'm working on a portfolio site that loads external images and swfs (using loadClip). Many of the swfs are banners that have stuff that's viewable off the stage...whoever developed them wasn't smart enough to mask it off, and I don't have the source files.
The first problem I have is the extra stuff is showing up when i load it. The second is that its messing up the width and height properties of the clip (which I need to use to resize a frame that fits around the loaded swf/image). Is there anyway to get the size that the swf document was actually set to with actionscript? That way I can set up a mask. Otherwise I think I'd have to manually create an fla with a mask and correct size for each existing swf that externally loads that swf. Unless anyone can think of a better solution?
Maybe the title is not self explanatory but in most iphone games eg you click the correct example and you see a +100 points mc appear and rise and alpha out. I did this with a png done in photoshop BUT not all goes well - it doesn't work.
[Code]...
It seens perfct but I can't see it work. The funny thing is that the custom currentBubble - with a dot after you see the code hints but a dot after pb100 - you see no code hints. Well not normal.
im trying to use this fullbrowser scroller in my site but it appears only if stage/ browser window is resized with mouse. it should appear right away! here is the site ad-d.org and here is the files ad-d.org.zip
I'm trying to create an application that will allow searching of a database and create resulting movie clips on the stage. Is there a way to select all the movie clips that fall within a certain region of the stage?
AS3 and have been searching the internet looking for an answer without much success - hence this post.What I am trying to do is detect if the stage (flash object) is on the screen or if the person has scrolled and it has gone off screen. Does anybody know how to do this?
I am trying to track mouse location on the stage in a swf file with Action script. I found properties that appear to have x and y location, stageX and stageY as well as localX and localY. But I am getting compiler errors to the effect of attempt to access possibly undefined property: as follows: 1119: Access of possibly undefined property stageX through a reference with static type Class.
I am working on a project and need to allow someone to access a social media site like twitter for example. I need a way to display their twitter page from within flash.
I'm trying to figure out what's wrong with this code:
[Code]....
I have a sample XML file with two images. If I remove either of the items from the XML, it everything displays fine, but with 2 items in the XML, the first item doesn't show an image, but the second does (maybe the first is being attached in a position behind the second?)
I am trying to attach a movie clip at a specific location on the stage using the following code:attachMovie("plane_mc", "mc", 1, {x:50} );The statement above does attach my MC called plane_mc onto the stage but it won't attach it at the location where I want it to. The x parameter doesn't seem to have any effect whatsovever on the stage location.
supposing there is a movieclip in stage.. let's say its a circle with an instance name of "theCircle"..
the circle has to move / go to / animate to a random location on stage every 5 seconds... basically, the circle should move to the random location, stop and wait for 5 seconds, then move again to another random location.. again and again...
the code below is untested and incomplete.. but it is what i am trying to do... how i should go about this...
ActionScript Code: var randomXPosition:int; var randomYPosition:int; var positionTimer:Timer;
[Code]....
on the moveCircle function, i can simply set the X and Y of the circle equal to randomXPosition and randomYPosition... but that would just change the location of the circle, not move it.. i am trying to make the circle animate towards that location at a constant speed..
Ive tried looking in a whole bunch of threads for a solution to this probably common issue but to no avail.I have a bunch of objects of same type on the stage which are generated through code.Inside these objects which are generally at x=300 on the stage.
stage1 is the stage object I pass into my class.The trace output is as follows
(x=2.3, y=0) , 2.3 0
Now im expecting some values in there somewhere to indicate its actual location on the stage, ie, x=300.This isnt happening.Whats the correct syntax i should be using.
I have an object inside my flash file and i want to lock the object on 0 x-axis 0 y-axis but when i re-size my SWF file my object's location changed to another location how can i fix that?
I needed to make my document size larger. Is there an easy way to center all the content in the new size? Right now everything is flushed to the top left corner.
I am using preloaders to load "modules" of pictures. They are working but I need to unload them before navigating to the next frame (to load the next module). Is there a way to condition action upon leaving a frame? Do I need to create some kind of unloader before the preloader? That might be difficult because I won't know what page I am navigating FROM. Here is my loader [code]...