I have a simple code that seems to be giving strange results.
var startPoint:Point = new Point(x, y); // a point var r:Number = path[i].row + (-Math.floor((length * 2 + 2) / 2)); // just some math trace(r); // the math checks out and gives a 3 var tey = startPoint.y + r; //this gives a really strange return....
When I trace the next highest depth at the initial frame of my SWF it returns 9877. Is this due to the way I setup the objects and layers through authoring? The reason I ask is that this is somehow interfering with my attachMovie and unloadMovie (unloadMovie stops working after another 6 extra depths).
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()
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 building a play/pause button for my movie, and here's how I have it setup: The main button object is playPause_btnThe first layer of the button has a movie clip with the pause graphic, named pause_mcThe second layer of the button has a movie clip with the play graphic, called play_mcOn the button's click event, I want to set one of the graphics to 0 alpha and the other to 100 depending on the state, so only one graphic will show through The problem is, for some reason ActionScript returns UNDEFINED when I try to reference playPause_btn.play_mc -- and when I do a dump of the movie's objects, I see entries for _level0.playPause_btn.instance12 and _level0.playPause_btn.instance13 instead of the play_mc and pause_mc objects. Why aren't the objects' instance names accessible??
I have an 3 arrarys with names, if I trace them outside a MouseEvent it works fine, but as soon as I trace it inside a MouseEvent it returns as undefined.Here is my code:
So, in my main mxml, i have a variable defined as such:
[Bindable] public var studentsListDict:Dictionary = new Dictionary;
I also have the following imported:
[code]...
Unfortunately, the getStudentName function simply returns undefined every time.It wasn't working b/c you can't have numbers as keys in a dictionary. Simply casting them to a string during the declaration and look up seems to work just fine.
Well i have some labels at my timeline and i pass them as an array. The problem is at the onRelease event. It returns undefined. I cant figure out how to solve it.
I was re-using some old actionscript in a new fla. For some reason my scrollbar script didn't work correctly. After some debugging I found out the the maxscroll value was being returned as 2. Strange when there is only two lines of text in a 400px high textfield.
I published the same fla for flash player 7 in stead of 9 and the problem was gone??? Tried in 8 and there it was again. So something went wrong between Flash player 7 and 8, but what? Is this a known bug and are there any work arounds?
I've got a dynamic text field. It has text in it. I can trace "myTextBox.textWidth" and it returns 154. I'm publishing to Flash 6, but if I change to Flash 9, the trace returns 139. Any ideas why this is behaving inconsistently when changing publish settings? Any ideas how I can make this NOT happen?
But the trace always comes out to be undefined. Also, I have searched, and the basis for that code is (working) code from one of the results I found when I searched
I have a dynamic text box on my main time line with an instance name (NOT var name) of MCtxt. My textfiles have the variable of txtMC. I have a movie clip with a little ease bar on it. When the user mouses over the movie clip the ease bar goes to the mouse and, once it comes close to stopping, it triggers some AS to capture a number. Then I have a switch statement that does some stuff depending on the number.
So here is the code I have on that movie clip: onClipEvent (enterFrame){ if (_global.stopped == true){ //trace(_global.j); function textLoad(filename) { loadText = new LoadVars(); [Code] .....
Tracing j returns the correct number and the _root.date.text works just fine. But the text is not loading and the trace on the success returns an undefined. I have tried moving all of the loading text code inside the case but it doesn't work there either. All variable names are correct (quadruple checked, at least) so it's gotta be something with my code.
I have 3 square. smallest square s3 is inside s2. s2 is in side s1. each is 10px larger [code]how can I find the coordinate of child in its parent's coordinate system?
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.
I'm trying to attach a movie clip to the main stage using:
[CODE]...
However, it ain't showing up. Trace said the movieclip of that name is undefined, despite having the correct linkage and instance name. Anyone know why a movieclip might be MIA?
Code: package com.Advertising { public class AdvertisingBlock { public var troot[code]......
I then want swfDisplayer to extend from AdvertisingBlock But because AdvertisingBlock expects stage,troot,constant, I have to use super in swfdisplay?? Does that sound right?? so something like....
when I trace advertObject from swfdisplay its empty... "undefined" But tracing from advertisingblock obviously shows it as being the object that was written to it.Is it because "supering" basically creates a new instance of advertblock? but one that you can access?What I have been doing in the past is just not extending at all and just creating a new instance of SwfDisplay that doesnt extend.
we have this variable from the internet, val(0), in a dynamic text field we can see a digit from this variable. but when we use this variable in actionscript and test it with trace, the variable shows as undefined.how can we make this work without it coming up as undefined??
I'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'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?