How can I make so that each time this function is called, it will add a form into a hbox, and that form will have 2 buttons yes and no and put x into the text of a label.When the user is going to click on Yes I need to trace(x) and remove the Form from the hbox
This site has a flash slideshow with multiple people in it that scroll left and right. The people are buttons with instance names.
When the user clicks on each person, it triggers some javascript that loads the corresponding swf for each person. Currently it only works for the first guy with a specific name in there.
This site has a flash slideshow with multiple people in it that scroll left and right. The people are buttons with instance names. When the user clicks on each person, it triggers some javascript that loads the corresponding swf for each person. Currently it only works for the first guy with a specific name in there. How do I get the instance name based on what the user clicks on to use?
I have 100 buttons, named k1 till k100.I don't want any code inside the button.I need to make the buttons invisible when pressed.I get a currentframe back from something else (example 22) and at that moment I want k22 to be invisible (k22._visible = 0)
I tried: aa = k; bb = 22; cc = k+22; cc._visible = 0;
var sp:Sprite = new Sprite(); sp.x = sp.y = 40; addChild(sp);
[Code].....
I want different actions for different MCs, but I can't access my MCs. I gave them names btn.name = "btn" + i;, but whenever I tried using MCs instance name "btn0" or "btn1" and so on it didn't work. So what is an instance names for my MCs?
I'm trying to create a form that based on the users input would determine how many forms to generate dynamically. I have a base state with a combo box that contains 1-4. Bases on the users selection I would like to have the next state generate the number of forms. So if you user selects 2 and click next - 2 copies of the form would be display.
I'm just wondering if this is possible how i would go about doing this or if any one knows of any examples?
I have a class which crate a panel with close button. and i create an instance of this class like this
function _smallThumbClick(evt:MouseEvent):void { var _popup:Popup=new Popup( square.width ,evt.currentTarget.y, evt.currentTarget); addChild(_popup); }
and this mouse event from the thumbnail(suppose), so if i click on the thumb it will create popup. so i want to close all other or previously opened pop window.
How do u get the popup class object to close from another class..
or is there any alternate method for detect instance of the movieclip or class..
I've added a movie clip dynamically using the following code:
var apie=new cPie() apie.x=100 apie.y=100 stage.addChild(apie)
I now have a pie on my stage. Yum. Assuming this works like a movie clip placed on the stage by dragging and dropping, I added this in to change an instance in the pie.
I've worked out a way to get the proper instance name in stored in a variable (called listName), and I've got a SOUND_COMPLETE listener applied to my sound channel. What I need to happen is, when the function called by the SOUND_COMPLETE event fires, the object on the stage with the instance name that matches the string currently stored is affected.[code]...
Is there any way to dynamically give a movieclip an instance name? This little process is gonna be spread out to a couple hundred dots, and while it's not really all that hard to type in the variable by hand (in fact it'd "only" take half an hour or so), but the more done dynamically the better, I think.
What I want to do is have a simple movie clip which checks it's own instance name as a variable, and then gotoAndPlay("thatvariable");. For example, say I have a movie clip with instance name "a1". On the clip I'd like to put onClipEvent (load) { this.gotoAndPlay(_root.a1); //but in place of "_root.a1",
I'd like to be able to call the instance name so that I can copy and paste the code to multiple movieclips without manually changing the name. } _root.a1 is a variable which contains the name of a frame inside of a1, so when you boil it down, it's just telling itself to gotoAndPlay("framename") in a roundabout way. Is this at all possible?
What I have is a navigational button. On click, it adds a MovieClip that contains a SWF.This SWF is a third party news reader/blog. My problem is that when I click on another Navigational button, I can't remove the added SWF (whether I use removeChild() or unload()).The container MC that was added to hold the SWF is removed but the newsreader stays. I assume this is because, that while the newsreader itself works great, it has too many unremoved event handlers, connections.
My main problem is that I can't figure out how to call that added swf by it's name and where on the displaylist it resides. Because I really want to use this newsreader, I've come to accept that I can't remove it. What I'm doing instead is trying to set up a conditional that looks to see if this SWF is already on stage, if so, do nothing but make it visible again(don't re-add the SWF).This is what I have so far, but it's not working (or at least not working without error)
Code: var blogNewsMC:BlogNewsMC = new BlogNewsMC(); function loadBlog(url:String) {
In the following code I would like to be able to change which object the code affects depending on which parameter name is passed to it:
Code: EventCentral.getInstance().addEventListener(ProjectEvent.SOME_EVENT, handleSomeEvent); function handleSomeEvent($event:ProjectEvent):void
[Code].....
I could write it all out with ifs and else ifs for each parameter but this code is already part of quite a large structure and it would be more elegant to be able to do it with re-usable code.
I'm trying to do it is particularly idiomatic to actionscript anyway
I am working on a project at work that will be a data driven, county-by-county map of the United States. We have received a FLA file with all of the counties (3000+ of them) demarcated and placed properly. In addition each county is a unique movieclip in the library, with a unique library name. However, the instances on the stage have no name at all. In order to reference an instance it has to have a unique name, but I do not want to have to go through and name them all by hand as this could take me weeks. The names they have in the library are meaningful numbers (FIPS codes) and if I could just name each instance with the name it has in the library (since there are only one of each library movie clip in the stage) that would be great.
Is it possible to add a textField dynamically but have different instance name each time this is created? In other words if I have a button that whenever its click it will add a textField to the stage and assigns a new instance each time this is added.
Code: button.addEventListener(MouseEvent.CLICK, addField); var inputWidth = 200; var inputHeight = 20;
I'm trying to write a little flex app that has a paint/canvas type feature to draw an image, which I then want to post to a rails server side. I'm following the post here, but can't get as far as he did due to the following error: NoMethodError (undefined method `rewind' for #):I googled that and found this which says the problem is due to an empty filename, but I thought I had that from the example. However, I altered the example to simplify the post by reducing the form parameters, but I could have easily messed something up since I really don't know what I'm doing with this multipart form content. I was hoping to at least log the request params, but unfortunately I can't, since it's failing before being routed and due to my inexperience with rails. I'll ask that in a separate question and hopefully be able to edit this question with the request params.
I'm trying to define this function so I can pass the CardButtons sprite to the Add Cards function. It "works" but there's one problem: the CardButtons sprite used in the function is determined by the value of i at the time of the function call (or in other words, the value of i when I click the sprite).
I want the sprite passed to be literally the value of CardButtons[i] at the point when the function was defined.
This is a very basic question. I'm rather new. Just wondering how one creates and manipulates dynamic objects, when they were designed in the library- not dynamically.
I want to make symbols in the library (linked to classes) and then dynamically create them and manipulate them in the actionscript code. But when I create them in the code, any instance names of sub-symbols cannot be referenced...
The instance name is "instance244" and not "leaf_text" which I set under [properties>instance name]
I have made basic code to draw boxes pending on user input. createEmptyMovieClip("box",_root.incramenting_var) ; how can i set an emty movie clips instance name dynamicaly? example: instance.box = "new_instance";
I have an instance of button with a dynamic text field which is getting the text from an external txt file. What I am trying to achieve is to have it load from a different text file based on its instance name. The end result i want to achieve is each instance of the button has its own unique name based on its corresponding txt file, i assume this can be done based on its instance name.
The code I am using is below
ActionScript Code: var button_text:LoadVars = new LoadVars(); button_text.onData = function (src:String):Void { if (src != undefined) {
I have loaded an externally SWF (sonswf) file inside my movie (parentswf).
son.swf has 2 objects inside its library: Character (Base Class = "flash.display.Sprite", Class = "Character") CharacterHead (Base Class = "flash.display.Sprite", Class = "CharacterHead")
The "Character" object has inside 1 instance of "CharacterHead" and "CharacterHead" does not have a instance name asociated with it.
This is something like what i have got so far inside parent.swf :
ActionScript Code: var ipAddress:String = "NNN.NNN.N.NNN" // not important var loadedSwf:Array = ["THIS IS WHERE I CAN GET SONSWF", null] var loader:Loader = new Loader();
[Code]....
So i need it to trace the class (not the Base Class that it extends) when instanciated from the parent.swf
Is it possible to add a textField dynamically but have different instance name each time this is created? In other words if I have a button that whenever its click it will add a textField to the stage and assigns a new instance each time this is added.
ActionScript Code: button.addEventListener(MouseEvent.CLICK, addField); var inputWidth = 200; var inputHeight = 20; function addField(event:MouseEvent):void{ [Code] .....
Something like this but instead of textFieldName this would be different each time.
I am using attachMovie in a for(var i=1; i<50; i++) loop.Everything loads fine, but I am having difficulty referencing the dynamically created instance names.I don't want to reference individually ie movieclip1, movieclip2 etc.but more by movieclip[i].Basically - if movieclip instance 1 is rolled over I want to display image 1, and so on?
I am trying to use a for loop, to place 5 instances of the same movieclip on the stage. In the loop I used .name to give each movieclip a unique instance name. But when I try to reference one of those instance names in an event listener I get an error. Here is an example of what I am trying to do:
Quote:
var xPos:int = 120; var yPos:int = 60; for (var i:Number = 1; i<=5; i++) {
[Code].....
This code generates an error saying that the cStar2 property is undefined. In the example above, does the for loop create 5 copies of the movieclip starC_moov, and give them unique instance names cStar1, cStar2, cStar3, cStar4 and cStar5?