ActionScript 3.0 :: Append EvtObj.target.name To A Function?
Mar 8, 2011
What I'm trying to do is have a website where there are menu buttons on the sides and when you Mouse Over any of the buttons, the picture in the middle changes. Ideally I'd like to set it up so that the image in the center stays until the next button is touched and then it is removed and replaced with another button. Now I could manage this inside the timeline, but it would take a very long time so I'm trying to figure out how to do this with AS3.This first bit of code I used was as follows:
I recently had to tell a client that I didn't want to work on their project because I was unclear about something. When you append a recording from a stream does the metadata get updated correctly after the append? I've worked with metadata before and from my recolection anytime a .flv was changed I had to manually update the metadata.
I have an XMLList: Code: var contentList:XMLList = loadedXML.someNode.elements(nodeFromNavElement);
Where "nodeFromNavElement" is a var being passed from a movie clip the user clicks on. That all works fine. The user is now in a particular section of the Flash app, and the content being pulled from the XML corresponds to the section. If the user clicks another movie clip (or navigation element, the content needs to update.
I need to get another node within the current node, like this: Code: var contentList:XMLList = loadedXML.someNode.elements(nodeFromNavElement).elements(nextNodeFromNavElement);
But I'm trying to append to the XMLList... something like: Code: var contentList:XMLList = loadedXML.someNode.elements(nodeFromNavElement) + .elements(nextNodeFromNavElement); Which obviously doesn't (and shouldn't) work.
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'm trying to target a function in one class from another. i'm able to call the function using(public static function imagecount()) but i can't a variable out side of that function. when i do i get this error:
1120: Access of undefined property _imagecount.
so below from call 'person' i want to call fucntion 'imagecount' in class 'model'. the call works but when i try and define a variable in class 'model' that is incremented in the 'imagecount' function i get the above error. it seem that my function has to be of type public static to be accessed from the other class.
///////////////// model class package com.model { import flash.events.*;
'm trying to break out stuff that happens on a mouse click into a function so that function can be called at another time. here's what i'm trying to do:
function itemClicked(e:Event):void { passoff(e.target); trace(e.target.name); //menuItem1
[Code]....
the above is obviously not working but i'm wondering how this should be done.
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.
I made a flash site and one of the pages has drag and drop functions with drop target actions, so that text appears once dropped onto a target.It works fine but when I have it loaded inside an external editor, the drop and drag still works but the drop target function stops working.
I've created an empty movie clip on the stage called 'photographs', to which I've attached a movie which I've given the instance name 'p1_mc'. This movieclip contains another with an instance name of 'p1_mc_base', which in turn contains a third with an instance name of 'close_btn'.
I need to target 'close_btn' to call an onRelease function. I'm thinking the path would be:
_root.photographs.p1_mc.p1_mc_base.close_btn
which is borne out when I list the objects in the movie, but I can't get it to work. I've used getNextHighestDepth() with the createEmptyMovieClip and attachMovie functions.
I created an array with movie clips now how can i target one movie clip with event handler function . so that when i clicked on one movie clip a message should be displayed
does anyone know if it's possible to target values stored in an array in a function from anywhere in a movie? e.g var Pressed:Array = item trace(Pressed)
if i trace the Array name within the function it spits out values, but when i try and access the Array from outside of the function it doesn't work.
This animation is for a kindergarten course. I have 6 different colored teddy bears on the floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can't make the bears stick to the target area. The target area has to be the same for all 6 bears.
I'm using a for loop to creat a bunch of identical movie clips I want to attach a different sound to each one of these clips. Is there a way to append a variable onto the end of another variable name. (ie. where i = [0,1,2,3,4,etc] variable[i] = variable0, variable1,variable2,variable3,variable4,etc.) below is the part of the code that I am trying to get working:
for (var i:Number = 0; i < xmlData.object_count; i++){ //create movie clips var boxContainer_mc:boxContainer = new boxContainer();
I'm writing an XML preferences file for an Adobe AIR project, and I'd really like to include XML comments. How does one append a comment to XML? The following doesn't work (the file just ends up with a blank line where the comment should be):
ActionScript Code: var prefs:XML = new XML(); prefs.ignoreComments = false;
What I would like to do is simply add to a dataProvider, but when I do, I get an error. Here's the code I'm trying to run...
dg.dataProvider.addItem(obj.ResultSet.Result[i]);
It's inside a for loop, using i as the integer. It works great doing...dg.dataProvider = obj.ResultSet.Result But that won't work for me, because I need to add to the dataprovider more than once. I'm getting results in batches of 10, and I need to add each batch to the dataProvider when it's received. I also tried to to do...
var dgDP:dataProvider = new dataProvider(); But for some reason Flex doesn't recognize it...
I need to append 4 letters to my variable name when referencing it to get either spanish or english XML data. I am trying to reuse my functions without writing an if statement.
like so:
//two options for var spa_my_videos:XMLList; var eng_my_videos:XMLList;
Is there a way to append an object that has already been created: CODE: userobject; userobject = {uname:username, uage:so.data[username].age} What if I wanted to add a phone property?
I have a flvplayer assigned to the id player and I am trying to set buffer times for videos I have embedded in an array, I understand how to pull the information from my array and have that value be set intoplayer.setBufferTime(value);but when ever I call that command it gives me the error1061: Call to a possibly undefined method setBufferTime through a reference with static type fl.video:FLVPlayback. player.setBufferTime(1);
I am using adobe dvrcast to record my live streams. the problem I am having is when I stop the encode during a live stream, a new file is not created, the existing stream is written over. How can I preventive this from occuring. Is there a way to have all vod files that are in one folder to roll over to the next file during play back.
I am using this method to fix the Active Content issue,[URL]but now I have come across a situation when I have to append the end of the .swf. EG: Active content fix script. It does not use the extension .swf
Due to the target website restriction, it only accepts swf file, and I want to pass parameter to this, So I post http:[url]............pass the file parameter this way, and This worked before, But now it doesn't, Where do I do wrong?
I need to append MIDI files: leave header (same for all files) and other meta information, just copy music/score part. I already have MIDI files in appropriate bytearrays, as I guessed I need to use writeBytes, but unfortunately couldn't find which bytes I need to take and copy. Something like this:
var newFileBytes:ByteArray=new ByteArray(); newFileBytes.writeBytes(firstMIDIBytes); newFileBytes.writeBytes(secondMIDIBytes,8);
Works only partially, file is playable; first part fully and second - only some notes (then player hangs out)
To say truth byteArrays aren't my strong side, as the MIDI file structure.
I am using this method to fix the Active Content issue,[URL].. but now I have come across a situation when I have to append the end of the .swf. EG: Active content fix script. It does not use the extension .swf