How can I combine the following functions and still pass a different string to the buildUI(); function?
I have two functions that do the same thing only at the end they both call a function and pass a String value to the function. This string value is the only thing different.
Below is are my eventlisteners and functions as they are now:
female_start.addEventListener(MouseEvent.MOUSE_DOWN, startFemale); male_start.addEventListener(MouseEvent.MOUSE_DOWN, startMale); //FUNCTIONS THAT DO THE SAME THING AND BOTH CALL buildUI BUT PASS A DIFFERENT STRING.
What is the difference between target and currenttarget in flex?What is the difference between Target and Current Target in Flex especially in mouse events.
var profileholder:profileHolder=new profileHolder ;
inside of profileholder is another movieclip(infoBtn) that acts as a button.when the mouse is over profileholder i want to do something with infoBtn like:
//profOver is the over state of profileholder function profOver(e:Event) { e.target.infoBtn.alpha=1; }
this doesn't work and brings up this error:ReferenceError: Error #1069: Property infoBtn not found on flash.display.Loader and there is no default value. at main_fla::MainTimeline/profOver()
i also tried: function profOver(e:Event) { var item:profileHolder=e.target as profileHolder; item.infoBtn.alpha=1; }
and get this error:TypeError: Error #1009: Cannot access a property or method of a null object reference.
I'm having to pass data (originally read via an XML file loaded by the parent class) to a child class upon instantiation, and I can't decide which is the better method.I could parse the XML in the parent and throw the data into an Object and pass that object to the child class....or just pass the part it needs as an XMLList and let the child class do the parsing.Seems like a trivial decision, yes, but I'm not sure of longer-term implications.
Trying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?
Code: something.onRelease = function () { var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }
I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.
i don't know why this isn't working.i got a button. and when it's pressed, i need it to go and play a frame in a movie clip. i'll test it and then when i click on it, i get this:
Target not found: Target="whoweare" Base="_level0.instance20.instance48.instance49"
this is the code that i am using:
on (press) { tellTarget ("whoweare") { gotoAndPlay (51); } }
Through attachMovie I have loaded an mc from the library onto the stage into "holder_mc".
myButton.onRelease = function () { if (currentWork != "holder_mc.myWork1_mc") { holder_mc.attachMovie("myWork_mc","myWork1_mc", getNextHighestDepth()); currentWork = "holder_mc.myWork1_mc"; } }
This works.
However, there are a couple of buttons (mc) inside "myWork1_mc" which skips through a few slides in the myWork1_mc clip that I cannot target. I thought using:
holder_mc.myWork1_mc.buttonName_mc.onRelease = function () { trace("MC_pressed"); }
... would work. My curser doesn't even change to the hand symbol. How do I target an dymanically loaded MC from the library which is inside an empty holder MC on the stage via attachMovie? What am i missing? Believe me, I have spent hours trying to google it.
Note: at this stage there is no other script on "holder_mc", but there will be at a later date, but I'll cross that bridge when I get to it. Also, the buttons work when I place the MC onto the stage and not use attachMovie.
I have a simple button that goes to a URL when clicked, but it's opening a new window. I want it to target "_self"-- but I'm getting errors. How do I properly target the same window?
Instead in AS3 I have to do this for a button action:
Code:
myButton.addEventListener(MouseEvent.CLICK, myButtonFunction); function myButtonFunction(event: MouseEvent) { var request:URLRequest = new URLRequest("http://www.sample.com"); navigateToURL(request); }
How do I add the _blank target function to this AS3 code. I am still trying to get use to this AS3 concept.
I have a flash template that I added a flash and xml driven component to. The component is a carousel menu with a lightbox that displays images. The lightbox part of it keeps loading behind my flash page, no matter what I set the z-index to on the lightbox.css. Is there a way to control the z-index of the flash file in the website's style.css? I tried adding it to the Body of the css but that doesn't work. How do I target the swf? I've never used css before. How to get it to load the lightbox above the flash.
does anyone know how i can matching random value. what kind algorithm that i need to use? the value is no always close to the first value. ex : array 6 x 6. location first value is in 1.1 and the second value is in 3.4. the question is what algorithm i have to use to get value from target value?
I have a monster_mc that shoots a bullet_mc at a target_mc.When I click the Keyboard.RIGHT the bullet jumps once then hesitates or pauses then continues -=25 pixels, instead of shooting smoothly.Am I missing something here?, can I make it perform better?
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); target_mc.stop(); function keyPressed(event:KeyboardEvent):void[code].....
I am using AS3 and PHP. I have created a flash animation and and it put in a index.php file. Its a web site, some pages are in flash and some pages are (like shopping cart) not in flash. My problem is when i am in pure php page (cart page) when i click the link about us, it should go a particular frame or particular content in the flash, instead of running from the beginning.
I have a simple event listener which calls a functions which first uses a switch case statement to determine what evt.target was pressed by name so I can assign info there--presently I just have trace statements--the problem is that it only works once and then I just get instance29 and the switch case evaluates to the default.
Code: lifering1.addEventListener(MouseEvent.MOUSE_OVER, playSplash,false,0,true); function playSplash(evt:MouseEvent):void {
I want to redirect the following code when the target isn't available.
function buttonClick(event:MouseEvent):void { gotoAndStop(event.target.name);
[Code]....
The code works great but I'm building a large site and would like to have a default swf that loads when the target isn't available. I tried various if statements when event.target.name == null but haven't been able to get any of them to work.
On frame 30 of my root timeline, I have dragged five different instances from my library onto the stage. I gave each one a distinct name, oneBtn, twoBtn, threeBtn, fourBtn, fiveBtn. I added a MouseEvent for each of these five objects, and ran a Trace to make sure I am able to identify the objects. At first, I used e.target.name but it returned instanceXX (instance23, instance84, instance83...). I think this happened because within each of those buttons, I had a movie clip within it so I can apply filters to them. I decided to trace e.target.parent.name. On two of the five objects, I was able to trace oneBtn, and twoBtn. On the other three, I still got instanceXX. I tried tracing e.target.parent.parent.name and I was able to trace the other three buttons, threeBtn, fourBtn, fiveBtn.
how come I need to target two different levels (e.target.parent.name & e.target.parent.parent.name) on my objects when I dragged them from the library and placed them onto the stage within the same timeline?
I had this posted in another post I had which was answered and it also had a lame post name so I have reposted it here I can not figure out why my code here is not working.... (i guess that's pretty obvious or I would not be posting it!).
Would you mind taking a look at this and possible you can spot what it is that I have wrong?
I am getting the error:TypeError: Error #2007: Perameter url must be non-null. at flash.display::Loader/_load() at flash.display::Loader/load() at asFiles.reality::RealityScenarios/loadImage()[C:(networkpath).as:226]
When trying to target a MC from within a function in CS3, I often run into problems though I still can't put my finger on it. When targeting the movie clip outside of a function (in this case I'm populating some dynamic text fields) everything is fine. In those cases, I use "this." in front of the MC name. I've tried that syntax and the the MC instance name without "this." within the function and nothing. So I seem to be missing something fundamental about AS3.
I have a movie clip on my stage that has its own timeline with 7 frames, each a keyframe with different content. How would I target a movie clip that appears only on one of these frames within the parent clip?
I'm used to using dot syntax to target clips within clips (eg. parentClip.myClip.onRelease = function(){...), but when I try this with a clip that only appears on one of the frames in the parent clip it doesn't work. Do I need to address that frame specifically? How would I do this? I'm using AS2 in CS3 on a Mac.
I have some buttons working great on my main timeline using this code on the actual timeline[code]...
So I know I need to make Revlon_mc into another movieclip (so I can do the actual animation inside this movie clip and move it easily around the main timeline) but I'm not what the code would be (something to do with parent perhaps??) and would I still keep the code on the main timeline or would it sit within the new moviclip just created?