ActionScript 2.0 :: Use .getDepth() But It Returns Nothing
Apr 6, 2005I'm trying to use .getDepth() but it returns nothing. :S
Code:
if (this.getDepth() < _root.blocks.getDepth()) {
I'm trying to use .getDepth() but it returns nothing. :S
Code:
if (this.getDepth() < _root.blocks.getDepth()) {
I have a load file and a write to file method. We all know what they do. How ever load always returns true and write always returns false....Right there you know somethings wrong. Because The forums have an issue with me posting code...I posted it here: [URL] Based on this code what is the issue here? why is write always returning false and why is load always returning true? (even for files that do not exist). My understanding is that if flash cannot find the file it should write to it will create it and if it cant load said file, then that method should return false.
View 6 RepliesI'm having with a menu navigation system. I'm using Flash MX. I have created a menu system for the site I'm building ([URL]) where one of the buttons "Choose photographer" drops down a list of names. All the other buttons just jump to another page. The drop down is currently using tweens also the logo moves to the left as the dropdown appears and returns when the dropdown returns. All working fine apart from its a bit jerky.
It's I just wanted to get away from tweening and use action scripts instead, as I'm a newbie to all things Flash I trawled the net for tutorials and examples so that I could cobble together the exact same effect. I have managed to get the drop down work and return using the action script and it does seem smoother and works slightly better. But can I get the logo to move to the left and back in time with the drop down...no.
I have a flash file, and in it is a movieclipbutton. When you roll over the button, the button has to grow in size and change color. This animation is 10 frames long. When you roll out, the button goes back to it's original size and color, this animation is also 10 frames. But when you roll out of the button before the 10 frames of roll over animation are finished, the movie jumps to the rollout animation, which starts with the button in grown size; so you see a little jump in size. To fix this, I did the following for the onRollOut:
Code:
this.btn_1.onRollOut = function() {
this.gotoAndPlay(45 - this._currentframe);
}
This however, doesn't work. When I put a trace(this._currentframe) inside, it returns 1. But this isn't right, it should return something between 10 and 20! I have the .fla file on the internet:[URL]
My XML looks like this...
<feature title="This is my /n features title"/>
I don't have access to change the schema.
In Flash I load the text content of the title attribute into a text field, problem is -- the prints instead of operating as a carriage return (new line).
Again, no access to the XML so changing the TextField to htmlText and adding a <br/> tag wont work.
What is the ActionScript 3 function that returns the type of a variable ?
I remember that there is one but I can't remember it nor can I find any reference of it.
I have a Flash output file that uses both LoadVars and XMLConnectors. While LoadVars all work on all tested browsers, XMLConnector does something very strange and ONLY on Internet Explorer. When I try to use it, the listeners for the XMLConnector say send (using GET Method), status is correct (StatusChange), but the data that returns is crazy (outputs 11). I am suppose to get a full xml data stream, but all I get is 11. This happens in IE (PC) only. In Netscape on PC or Mac) it is fine, on Firefox (PC or Mac) is it fine, on Safari it is fine. SO, has anyone able to use the XMLConnector properly on IE (FP8)? The parameters for the problem are: Flash Player 8, Internet Explorer 6, PC.
View 3 RepliesI have few ActionScript skills. But I have built a multimedia career by stealing chunks of AS2 code and reworking them to suit my purpose. I have searched long and hard here for a solution to my current problem. I have found code here that seems to address it, but I cannot make it work. I simply have some textAreas that I wish to validate. The user may input text that could include extra spaces, returns, and odd capitalization. It would be easiest for me to simply strip out the capitals, spaces and returns. I found some simple code that changed the caps to lowercase:[code]
View 5 Repliestrying to cut text field to single letters and then do some animations on each letter. But, how do I know where to place (position) the letters? I tried using getCharBoundaries but once it reaches 3rd line, it keeps returning null values. Anybody knows why that happens
View 3 Replieswe are told to make a sort of calculator, You should be able to input a number, press a button and then it should do several mathematical steps and it would end up with the number 1
Here is what I've got so far:
ActionScript Code:
var input:Number = 0;
var summa:Number = 0;
var output:Number = 0;
[Code].....
The script works fine when not entering a number in the text box, it calculates just as it should.
But if i enter any number, it shows up as NaN in the trace. I've asked my teacher and he doesn't see anything wrong with my code, and neither can i..
I'm using Adobe Flash cs5, actionscript 2.0
I really don't understand how the results I get are possible.Here's my code:
ActionScript Code:
patch = 0;
//Assign the correct percentages using the data recovered from the database[code]..........
And, here are the traces I get:
Quote:
int_tmp: 66.6
int_tmp: 66.6
int_tmp after: 66.6[code]....
my code somehow manages to say that the result of 66.6 + 33.3 = 99.89999999999999
It might be possible in some alternate universe, but here on earth, I should get a result of 99.9... I'm really hoping one of you can explain to me why Flash returns that result, cause really, I'm at a loss here... this line:
ActionScript Code:
var int_tmp:Number = int((nbUserArray[t]/nbUserTotal)*100*10)/10;
I made sure the values are the correct ones, plus the traces confirm that the first time, it equals 66.6 and the second time it equals 33.3. So really, I don't understand how it can return this... monster of a result .
When I use it with either byteArray or Vector as the input and either as the output, it returns the first few results correctly, then gives me either nonsense values or zeroes. The following shader takes values, returns the second number plus the third for the first value, a zero for the next, and the output coordinates for the last two numbers. The channel size is therefore 4. The length of data is 56 (divisible by 4).here is what I have in the evaluatePixel function:
Code:
dst = sampleNearest(src, outCoord());
dst.r = dst.g + dst.b;
dst.g = 0.0;
[code]....
and then, as you can see, fine again after 47. Changing the length of data to 80 is the same, only after 31, the values remain nonsense instead of eventually correcting themselves.That list is just a trace of input and output.
I'm triyng to get the browsers back-button to work with my flash site. The general principle is this:There is an index.html page containing an (not yet) hidden Iframe and the flash movie.The Iframe contains page A, which starts with JavaScript calling a BACK-function on the index-page.The BACK-function triggers an AS-function in the flash-movie that activates its own back-button, and then changes the URL of the Iframe to Page B. This causes a new History to be added to the browser.The flash movie now contains 5 frames (labeled in the middle of the stage) and two navigation buttons: back (Terug) and forward (Verder). Those buttons do exactly what you'd expect them to do (prevFrame and nextFrame).On a PC (IE) this seems to work pretty well. But on a mac nothing seems to work propperly.Here's the code I have on the first frame.
stop();
_root.terug.onRelease = function(){
prevFrame();
[code].....
I have written a ToggleButton class - a button that toggles an object implementing an Itoggleable interface - a reference to which is stored in the ToggleButtons 'target' property. Toggleable contains a reference to an instance of whichever ToggleButton it is a target of.Now, I can easily create this relationship like so:
PHP Code:
myToggleButton.target = myToggleableObject;
myToggleableObject.toggleButton = myToggleButton;
But what I would like to do is this:
PHP Code:
myToggleButton.target = myToggleableObject;
[code]....
1118: Implicit coercion of a value with static type org.ngfl.template.ui:ToggleButton to a possibly unrelated type ToggleButton.this seems to be saying that the 'this' reference is not returning the instance of the class but the class itself, am I right? Is it not possible to do what I want? It's only one extra line but I'd prefer it that way.
My AS3 class has some quirks. It's sort of a guestbook, so someone can add a 'question'under a certain category. When I publish the results in a dynamic textfield or when I trace the results I get the existing XML values and some undefined ones.This is my AS3 script:
Code:
//Class name is AddQuestionMenu
public function AddQuestionMenu()
[code].....
I've got an object inside an object. The child object basically loads a variable from SQL into one of it's own public variables. The SQL works 100%, because it traces out correctly.Now I've wrote a function from the child.as
Code:
public get_var() : String
{
return var_yes_friggin_work;[code].....;
Of course the files arn't called Parent.as and Child.as I've just had to rename them because our work is monitored though checking the internet and I can't delete this form.The FilePathOriginal doesn't output anything unless the string is manually set from the child, does anyone know where I'm going wrong here? (I can't upload all my code because of the monoriting process)
I am targeting Flash Player 7.I have created a call to a webService that retrieves the result Hello World, however, the value is only retrieved and displayed when viewed locally, when viewed online I get nothing.The embed and object script both have 'allowscriptaccess always' and the webservice is in the same domain.So I created a cross domain policy document just in case the web service resides on a different domain.URL...[code]Still works locally but a value is still not retrieved when viewed online.
View 3 RepliesTitle explains teh problem - anyone ever encountered this issue or have a solution. have tried everything - tearing my brains out
View 7 RepliesPerhaps I should leave well enough alone, but it bugs me that my hitTest gives me an error message even though it seems to work as intended. I have two movieClips running side by side. The second clip, the hitTest object is actually in an array that I keep pushing every second.
[Code]...
I have tried to trace cars[i].name and it returns "instance XXX" instead of what I would have expected, which would have been something like cars1, cars2, etc... If that is creating the error, I don't know how to fix it. I have thought also that perhaps the array itself is being referenced, but again I wouldn't know how to change it.
I try, in standalone test environment it always returns true - it should return false -
View 3 RepliesI have a string,for eg: "Welcome to flash forums!".I need a function that returns the number of words(sperated by spaces).The String is not user inputted,so if I need to include any thing between words to accomplish this, it is possible...
View 3 RepliesI have a textfield on stage and on RollOver I want to get it's background color?
my code:
this.createEmptyMovieClip("holderSub_mc",mydepth+21029);
this.holderSub_mc.createEmptyMovieClip(["sub1a_mc"], mydepth+15);
[code]........
I have an ArrayCollection with following structure (when viewed in debug mode):
[0]
- [0]
-- src
- [1]
-- src
src is the path to an image.
I need to get all of the src's out of the arraycollection. However because of the first (unnamed) node I can't take them in. I've tried ArrayCollection[0].children and save the result in another ArrayCollection, however the new ArrayCollection has 2 Objects in it but no 'src'. There are just 2 null objects
firstArrayCollection is filled with the data as described above.
secondArrayCollection.addItem(firstArrayCollection[0].children);
When viewing the content of secondArrayCollection i see following structure (and data):
[0] null
[1] null
I have a movieclip I drawn, called Map. It has a child with the name Wall. I'm trying to make a function that returns a 2d tile array of if there is something in that tile or not, for pathfinding. The problem is, levelGrid is entirely false. I'm not sure what I am doing wrong. I have filled the whole movieclip (Wall) with bright red, and yes it still returns false. The x and y of both Map and Wall is 0, so I don't think there should be issues with hitTestPoint accepting global x / y.
[Code]...
I'm talking about the div(X,Y) function in C which returns the number of times X is reduced by Y. if you're confused, I'm talking about this:
div(30,5) returns 6 (30 is reduced 6 times by 5)
div(34,7) returns 4 (you can reduce 30 by 7 four times, leaving 6 behind)
Is there such a function?
I am trying to get the value of a global variable from JS. The variable is defined in the HEAD section of my HTML document.
if(ExternalInterface.available){
return ExternalInterface.call("window.myVar.toString()");
}
As I debug my application this call keeps returning "undefined" but if I make the same call in firebug's console it returns a string as expected.
I'm trying to implement Gravity from GraniteDS. I did everything like in example from GraniteDS website, but when I'm trying to get gravity from servlet context, ravityManager.getGravity returns null. Here is the code: Gravity gravity = GravityManager.getGravity(contextManager.getServletContext());What can be the reason of this error?
UPD:
From web.xml:
<servlet>
[code].....
I'm working with the Flash Api for Google Maps in my Actionscript/Air project. I now need the latLngBounds (the top left, top right, bottom right and bottom left) values of the current view of the map. The function map.getLatLngBounds should do that, but it always gives me a really low lat/lng bounds back. Always somewhere around:
[Code]...
I am currently making a program to upload certain files onto a web server and I have come accross a problem.In my code I've got:
ActionScript Code:
if(fileRef.upload(new URLRequest("http://www.mackaygymnastics.org.au/administrator/upload.php"))) {
[code]...
Now I understand that this is returned because the upload function returned a false, but why is it returning this false. Is this because the URLRequest is wrong or the uplaod file is wrong or something else? I've tried looking all over the web for another case and it doesn't give me one.
I have created a Composite Pattern type structure, with TreeNodes and TreeLeaf Objects.I works fine, except when I seach in the treestructure for TreeNodes and TreeLeafs in a resurve function with a loop, the function returns null - even on a successfull match.
public function traceTree(inComponent : TreeComponent = null) : TreeComponent{
var parentComponent : TreeComponent = inComponent;
if(inComponent == null){
[code]........