I have a MovieClip MainGame that is associated with my external AS File where all the code lies. Everything works really well but.. I place an object inside the MainGame movieclip and give it an instance name . Now when I try to access it from the .as it says "Access of undefined property xy.."
I tried it with textboxes and movieclips, all the same.. I know it worked 20 times exactly like this and I have even compared an older Game where I accessed it just like this.... I really don't know what Flash is playing on me..
I'm having an issue accessing items on the stage from some imported code. I found this topic that discusses the same issue... [URL]
I'm not sure I totally understand how to go about this. I don't understand how to make the object global so I can access it from any class. (I have the same problem with an array I'm working with).
I'm trying to access a MovieClip created within the authoring tool from an ActionScript class. Here is my code:
PHP Code:
package { import flash.display.*; public class MoreVideos extends Sprite {
[Code].....
I also tried changing that to [stage.moreVideosBox.visible = false;], but I then got "1119: Access of possibly undefined property moreVideosBox through a reference with static type flash.display:Stage."
Is it possible to directly alter items in the authoring tool from a class? If I move 'moreVideosBox.visible = false;' outside of the class, in the main .as file, it works fine.
I have a serie of boxes (Destination) and a box I can drag (Origin). I want that when I reach each of the boxes in the array(Destination) with the Origin box, the Origin box is "attracted" by the Destination box (each one) and that the Destination box change its status from 1 to 2.I tried it and it has worked to me with a single Destination box, but when I have created the array of boxes I can't access each of them. Below is the code I've written so far to clarify better where I am.
Im trying to get used to packages and classes in AS3. Im used to put all code on the first frame of the timeline, but now i have 442 lines of code on the first frame. Yeah 442. And this is for a game engine so i thought i should put it inside some classes to make it easier to read an reusable. But i have noticed that if i create a class called Code and make a instance of that class like this:[AS]var codeObject:Code = new Code();[/AS]i get a bunch of errors because the class cant Acess the stage and the display list.i found a workaround by linking the class to a movieClip and and do this:[AS]MovieClip(parent);[/AS?
I have a CustomSimpleButton class and a CustomSprite class which creates a bunch of CustomSimpleButtons and displays them at runtime. How can I access other objects on the stage in Flash inside of my two custom classes? If I want an object tween to occur when one of my custom buttons is clicked how do i reference the object that I want to tween if I'm inside of my custom class.
I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names likeblueRod_mc, etc.I place them around with time-line code like blueRod_mc.x = 300.0;I have now created an Actionscript class called Problem.I build a new object from Problem which I have called Riddle.But when I put blueRod_mc.x = 300.0 in a method (of Problem),I get the message that blueRod is not accessible.So I triedstage.blueRod_mc.x = 300.0;That did not work either.
I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.
I've successfully access a web service in as3 and pulled the xml from it into a large array of objects
ie
Code: array object array
[Code].....
This has to be accessed at a later point by the UI in order to build itself. I can't figure out how to create a loop or method or whatever to access this array.
I need several ways of accessing it, so maybe I'm thinking of a method called accessSpecificItem(propertyName:String); <- to set up each UI item traceOutAllItems(arrayName:Array); <- for testing countNumberOfItems(arrayName:Array); <- for the UI to figure out how many items it needs to build
I'm practically new to flash and action script and i'm currently trying to code something. I have a *.fla file with a dynamic text..I created a separate *.as file for the action script. My question is how can i reference the dynamic text properties? for example if i put the following code on my *.as file dynamic_txt.text = "place your text here" this will produce 1120: Access of undefined property dynamic_txt..How can i reference the dynamic text on my *.fla from my *.as?
Access Objects from a external .swf i loaded a flash mx movie into a flash 8 movie, and now i need to detect if a button of the loaded movie is pressed but i simply dont know how.
i used:
Code: var news_mcl:MovieClipLoader = new MovieClipLoader(); news_mcl.loadClip("source.swf", newscontainer_mc);
to load the movie, and i have a movieclip inside it with the instance name "read", and i need the code to put in the parent movie (the flash 8 one) to detect a onRelease on that "read" movieclip.
I have a chart and am trying to display the "volume" in a line chart as the primary series & the "temp" as a column chart as the secondary series...(the "compound" will be shown in the datatip):
[{date=Tue Feb 08 19:00:00 EST 2011, volume=1200, 1={temp=-50, compound=helium}, 0={temp=-45, compound=oxygen}}]
I can get the "volume" series to display fine, but cannot get the "temp" series to display...how do I access them? Right now I have:
Can we use or access shared object stored in another system? I'm storing some data in shared object in one system can I access that shared object data from another system? I think Shared objects are stored in local machine. Can we give the path to (specified system i.e., server) where the shared objects will store, and can we access that object through same path?
I'd like to be able to dynamically access objects from with in a function. In javascript I might say something like window[objectName] and assign it to a temp var or call a method from it. How can I do this in AS3?
Use case:I have a currentReport var that holds the name of the currently active report. When a new report is called I want to unload the current report then load the new one and finally set the currentReport var to the new value.
I need to be able to make a large amount of concentric circles, using only the action script. I need to be able to alter each of these concentric circles independently from each other. Currently My code is as follows:
ActionScript Code: var circ1:MovieClip = new MovieClip(); addChild(circ1);
I created an array in my Main class and populated it with instances of a seperate class. Is there a way I can access the original array from within the instances of the separate class.
I've never actually fooled around with 2d arrays that much. What I need is to access an array and get all the objects inside of it. I actually mocked up a little something to mirror what I want.
I don't have any trouble getting the data, but as you can see that it's pushing each object separately in an array. So it would look like this: I just need to get all of the objects first like {obj}, {obj}, {obj} and then push them into an array.
i have a simple navigation system with three buttons, each button have a text field in it. On mouse over they change color to blue. I can achieve all these without a single line of code. I simply make a button of my text field in flash, and change the color of the text in the timeline.
My problem occurs when i want to make the color to stay blue when i click on the button. Apparently you can't access the child within a button, in my case a dynamic text field. I've googled this problem and they all say that you should use a MC instead of a button. Thats exactly what i have done so far. But i'm getting tired of writing a bunch of eventlisteners and put an extra layer with an invisible button in my button mc so i can get the hand cursor (because the .buttonMode = true and useHandCursor doesn't work when there is text field inside the mc). Any way, shouldn't there be a more elegant way to solve this problem?
I've been trying to build a new base class for my button that extends SimpleButton, and from there access the embedded child object, but the problem remains.
In this example i'm trying to simply change the text of the text field inside of my new MyButton instance. But i get the same old Error #1009: Cannot access a property or method of a null object reference.
package { import... public class Mybutton extends SimpleButton