ActionScript 2.0 :: MC Gets Deleted Before It Can Hit The Last Coords
Mar 8, 2005I'm trying to save some CPU resorces here but donno how.. my MC script is deleted before it can reach the current point.. what should I do?..
[Code].....
I'm trying to save some CPU resorces here but donno how.. my MC script is deleted before it can reach the current point.. what should I do?..
[Code].....
I'm trying to save some CPU resorces here but donno how.. my MC script is deleted before it can reach the current point.. what should I do?..
MovieClip.prototype.moveIt = function() {
this.onEnterFrame = function() {
menu._x = Math.round(border._x - ((border._width/2) + 68))+5;
[code].....
Waht is the right way to get 3D coords from 2D mouse coords using Away3D. (version 3.6.0) It's ambigoius problem in general, so there is restriction that 3D point belongs to some fixed plane.
There are some examples with camera.unproject and plane.getIntersectionLineNumbers methods, but they don't work if camera is rotated or plane is not trivial.
I deleted a project in flashbuilder and it seems to have deleted everything. how can i get this back?
View 1 RepliesIs there any way for me to move the mouse to a spot on the stage and determine what the x/y coords are? It's really hard writing some action script and just continually guessing what x/y coord i want until i get it close enough.
View 1 RepliesI have an mc that when I press a key it will either zoom in or out. Right now it zooms in/out, but it does with with the up-left corner as the point to zoom from. Can anyone direct me on how to zoom in/out where ever the mouse is relative to the mc? If the mouse is in the middle, then it zooms from the middle and so on.
View 5 RepliesIf you check my site I'm trying to make [URL] and click one of my buttons the menu/logo/music/.. will move to the coords..
Here's the script I used:
1st frame:
speed = 5;
Frame in which the action will take place:
MovieClip.prototype.move = function() {
[Code] ....
But if you try to click for example on the "contact" button and after "about" button you can see that my music button (right side) is closer to the main border... so why the mc's coords are little off if you had clicked different button before (or if the mc's coords are different than before)? [note that I need to use Math.floor and Math.round to make it look sharp and that the speed value is for all MC's number 5]. Also my MC location is set up to hole pixels..
I create a few squared sprites and then remove the first one and display the coords.[code] The x coordinate is still 0, though width has changed,getBounds shows correct values.I would expect x to change as well.Because of the wrong value of x, globalToLocal and localToGlobal work incorrectly.If you click somewhere on the left side of the second (still visible) rectangle you get: 2 28 (x=2, y=28)which is good for nothing. The values in brackets should be in stage coords and they are not.[code]
View 1 RepliesI've created a movieclip spawner class and animator class which animate movieclips along a set of x,y points.I've used Greensock's TweenMax to accomplish the animation and I have set the speed to be 1 second between each point. The issue is that when the distance between two points is small it looks too slow.
What I would like to do is somehow calculate the distance between the two points and output a speed in the range of 0 to 1 seconds so that the speed is to be correct for the shorter distances as well as the longer distances.
I have an image gallery that loads images/text through xml, but I'm having an issue with the scolling, I need to lock the ymouse coords right now it scrolls only on the xmouse, basically I need it to work in the scrolling area only, say 400width by 200height..
[Code]...
How do I tell the target to goto the tellers coords?
Code:
tellTarget("/Flame_" + (_global.numFlame-1) +"_mc"){
this._x = 100;
this._y = 100;
}
This is what I have and it tells the Fluid (the place where the above code is) to go to 100,100. that was kind of jumbled but I think I got it all in..
I've been working in CS5, with an older FLA I originally built in CS3. On the timeline, I have different MCs and button symbols which need to stay in the same coordinate position. Usually if I notice some sort of 'wiggle', I will go and check the position coords by hand, updating the x/y position by typing numbers directly in the Properties panel.
However today, I repeatedly saw the coordinates change -by themselves- after I typed and hit Enter. For example, typing '165' in the Y field changed immediately to '164.95'. With one symbol, this behavior continued, no matter what I typed, with the number changing by 10 pixels sometimes, every time I just selected the symbol. Not only was I not able to keep the symbols at the same coords (I tried making them all 164.95), the 'automatic decimal' numbers would actually change further, as I was trying to correct them. I was only able to resolve this by creating an entirely new MC symbol in the Library, and placing it on a new timeline layer.
I've noticed this sort of behavior before in CS3 and CS4 (the CS4 Alpha slider never wanting to go to 0 or 100%), but never to this extent, or as consistently. It's gone from an annoyance to a genuine problem in my workflow.
How come this PHP Code:
function drop (thumbClip, xCoord, yCoord) {
thumbClip._x = xCoord;
thumbClip._y = yCoord;
trace (thumbClip);
trace (xCoord);
trace(yCoord);
}
receives the variables (specified in a later function) and traces them all right, but refuses to deposit the variable thumbClip in the x and y coordinates being specified?
I replaced thumbClip with a specific movie clip, and the fucntion worked perfectly. Does this mean Flash cannot use variables to set the x and y coords to?
How come this:
PHP Code:
function drop (thumbClip, xCoord, yCoord) {
thumbClip._x = xCoord;
thumbClip._y = yCoord;
[Code].....
receives the variables (specified in a later function) and traces them all right, but refuses to deposit the variable thumbClip in the x and y coordinates being specified?
I replaced thumbClip with a specific movie clip, and the fucntion worked perfectly. Does this mean Flash cannot use variables to set the x and y coords to?
I've been reading through all the various threads related to the drawing API and saving drawings. About a hundred times I've seen mention of "log mouse positions into an array" and stuff like that, but I can't find any clear and simple examples of how to do this.
Let's take a very simple use of the drawing object to do freeform drawing. What is the AS to capture the mouse XYs as the user draws and put that into an array. I can't figure out how to get Flash to keep updating things as I go, it invariably grabs the fist point and that's it. Could one of you AS gods just write out a super simple routine for this? I know I'm not the only one that needs this (as it seems to be asked every week) Let's use the most basic drawing example I can find:
[Code]...
I've been searching extensively for a way of converting from ordanance survey coords to valid esri coordinates. I've found quite a few pages that convert to lat long (if a little off) but nothing to convert to esri (which I believe is utm.)This is for use in python or JavaScript / actionscript etc - I'm not too worried about syntax more an understanding of the maths involved.
View 2 RepliesI was sorting my symbols in my library moving them to folders and what not and then saved it, did some more drawing etc. Then tested movie and noticed that all my symbols are gone on my timeline, also noticed whenever there is a tween the symbol got deleted from that to. I was so pissed, I undo'd as far as I could go and it wasn't enoughI have ALL my symbols in my library, just ALL of them got removed from my timeline... there is a lot of them.
View 2 RepliesI was sorting my symbols in my library moving them to folders and what not and then saved it, did some more drawing etc. Then tested movie and noticed that all my symbols are gone on my timeline, also noticed whenever there is a tween the symbol got deleted from that to. I was so pissed, I undo'd as far as I could go and it wasn't enough -_-
I have ALL my symbols in my library, just ALL of them got removed from my timeline... there is a lot of them.
I am doing a small test with arrays. I have 5 purple movie clips, their instance names are: p1,p2,p3,p4,p5.
I have declared an empty array called purple. On press of each mc I want the particular mc to be added to the array, and on press again I want the particular mc to be deleted from the array.
However, this does not work, it seems to be deleting the lastly added mc name from the array no matter of which mc I unpress.
I am new with arrays, I am using pop and push. I will upload my file. Could someone have a look at it please? Is there another array command to add and delete the particular mc which is presses and unpressed, and not the one that was last added to the array?
what I have is:
- listener added with weak refference, therefore it shouldn't keep the GC away
- object set to null
- trace of the object m shows null
- debugger shows the value of m as null
But the "frame" trace still keeps on appearing, so where exactly is that object and how to check for it, how to delete it and kill it. I know that listeners keep objects in the memory, but then how to find them, and at the end of the day also used weakReference=true while assigning it, so that should take care of it. What exactly is going on here?
I created a empty folder on my desktop "Test" and then in the create a new project thing I linked it to the test folder, and then in the settings I clicked on delete project folder and it gave me two options and by mistake I selected the second one and then my worst nightmare, all my multimedia files which were on my desktop got deleted. I tried running 5-6 data recover softwares but none of them and I mean none of them found the files deleted by flash. All were showing me the files those were deleted by Shift+Delete, but that I dont want. How can I get those files which were deleted by flash cs5.
View 12 RepliesIs there any utility that indicates in a comprehensible way what is referencing and object and why it can't be garbage collected.
View 2 RepliesWe area trying to create a virtual world application. We are using hitTest to make the avatar enter the room. That hitTest event is inside an onEnterFrame event of the avatar so every time the avatar is on the stage it runs the function and detects if it hits the hot spot or not.
So onEnterFrame we have: (shortURL is a variable that points to the movieClip)
Code: Select allif(this.hitTest(shortURL.detectRoom1)){
attachDialogue(1, "room.swf");
}
[Code].....
The code works, however when the user clicks on no, the dialogueBox still appears since the avatar still hits the room's hotspot. If I remove the commented "delete attachDialogue" clicking the no button will remove the dialogueBox movieclip without any problems. However when the avatar walks on other hotspots it doesn't call the function again.
Are there other ways how we can remove the movieclip and set the attachCounter to 0 when the no button is clicked? Or how can we reuse a deleted function?
If I delete the "onEnterFrame" with this code:
myClip.onEnterFrame=function(){
____if (this._x<300) this._x+=5;
____else delete this.onEnterFrame;
____// to erase it, but you can simply empty it
____// else this.onEnterFrame=null;
}
How can I turn it on again?
I'll cut to the chase, here's my code:
Code:
function loadThumbs(){
for (var i = 1; i <= totalImages; i++){
[code].....
On my website, I display uploaded PDF files in a flash player for my users to read. I already use various tools to extract the text and produce a serious of high quality images from the file and the system works well. The last piece of the puzzle is to be able to highlight specific parts of the document to help users with accessibility issues.
However I cannot figure out how to calculate where the specific text is positioned on the page? Notes: The documents uploaded to the system are from 3rd parties, so fonts may be embedded. Meaning that I cannot be sure of the width of specific letters. The text to be highlighted may not be unique, the same text may be repeated How can I calculate the coordinates, height and width of a specific piece of text on a PDF, so that I can then draw a box around it?
how do i make a button trigger a movie clip that targets specific coords? I'm building a map and when a button is click it goes to a defined point. right now it jumps to the coords, but i'd much rather it smoothly move instead. the other thing is that i would like it to move from whatever point it is currently at.
View 11 Repliesin my main I have a system that allowed certain classes to be loaded and unloaded. When I load Game.as, it contains a trace statement when you press the left arrow key. When I remove the game instance from the stage, and set it to null, I can still press left arrow key, and the trace will come up. If I then make a new instance of game, it traces twice with only 1 click. When I close/load another time it traces three times.
I very specifically set:
Code:
mainContent.removeChild(game);
game = null;
Even trace statements confirmed that the game was being nullified, and the trace still continued.
I want to draw lines to make a region so that anything inside that region is deleted. The Case : You could say that there are many movieclips in stage but when I just selected by drawing circle or something even complex shape to it purposely then anything inside that shape is just gone.
View 3 RepliesI have this little crumby thing I'm working on. And in it, I draw a circle with a radial gradient fill. Then I add that circle to the array: "colourSplodeArray"
I have another circle that bounces around and hits walls, "creating" the previously mentioned circles. (So I have one that is not in the array, the rest are)[code]...