ActionScript 2.0 :: Access Image Name Of Movieclip?
Mar 21, 2010
suppose I drop and image : image.png onto the stage. I then convert it to an mc with the instance name image_mc.How do I find out the file name "image.png" from the movieclip using actionscript?[code]How would I then access the name "image.png" with actionscript if differerent from the method above?
View 1 Replies
Similar Posts:
Oct 16, 2011
what I'm trying to do is accessingsnapText = scrollPane.source.textSnapshot;from an external swf. I've tried:
trace("-->: "+scrollPane.source.textSnapshot.getText(0, 1000));
trace("-->: "+myLoader.content.textSnapshot.getText(0, 1000));
trace("-->: "+mc.textSnapshot.getText(0, 1000));
[code].....
View 3 Replies
Mar 6, 2012
Working on an RPG type flash, and I have to be able to control a text-box from quite a few locations. The one that is causing me trouble is the inventory. I need to be able to access the textbox with an instance of "statusWindow" from within the inventory clip (instance name "inventory"), so when I mouse over an item within the movieclip it will change the status window on the stage.In this instance I want to mouse over inventory.invHealth from the main timeline to get the display.itemName and itemProps are strings containing information about the item.I tried the following but it gave me a "possibly undefined" error.
invHealth.addEventListener(MouseEvent.MOUSE_OVER, itemStats);
function itemStats(e:Event):void
{
root.statusWindow.text = itemName+"
"+itemProps;
}
View 1 Replies
May 28, 2011
how can i access a movieclip via its instance name in another Movieclip class?
and a nother question how can i access a movieclip via its class name in another movieclip class?
BTW i want to access the movieclip child
View 4 Replies
Aug 13, 2009
I've got a dozen movie clips on stage, each with 3 children, and each of those have 8 children, as example named u01-u08.
Is it possible to access u01 directly without the parent names? like a wildcard? like the xml way of getting to nodes with a .. ?
sort of like: stage..u01.alpha = .5;
View 10 Replies
Jul 15, 2010
I'm making a fighting game and so far all the controls are good, characters can walk, run attack etc. My problem: The character is a MovieClip, Guy, and is exported to a class Guy. In Guy.as I have a boolean "hitting" which is set to default "false". If the Guy object hitTests an enemy while "hitting" is true, the enemy will take tamage.
In the Guy MovieClip there are about 7 frames, each with its own animation. 3 of those frames are attacking animations in form of MovieClips, i.e, if we click them we get another set of frames. Say one of the attack MovieClips has 10 frames in it, frame 7 of 10 is where the punch actually lands, this is when I want the enemy to take damage, not before (while the character is still moving his hand forward). Seeing as this frame is inside a MovieClip which is inside another MovieClip(Guy), is there a way to access the property "hitting" with this inner frame?
View 4 Replies
Jan 31, 2009
How can I show an image that I have just captured with the webcam?I am able to save that image using PHP but before I save it, I want to show a preview. How can I do this? Here is a snippet of the code that I think can be used to do this:
ActionScript Code:
foo = new BitmapData(640,480);
foo.draw(myvideoobject, scaleMatrix);
[code].......
View 3 Replies
May 9, 2010
I want to access the properties of movieclips inside a movieclip.
Below is a code of how the Parent mc is created. It's looped because it's gets it data from XML. So there is not one parent movieclip but a number of parent movieclips depending on how many items the XML contains:
Code:
function doComplete(e:Event):void {
//create a new variable to store an instance of the XML class. We pass through the data from the XML file.
var xml:XML = new XML(e.target.data);
[Code]....
View 2 Replies
Feb 13, 2009
An image, like a jpeg, has a bunch of metadata stored in it.The "IPTC Core" metadata usually includes the photographers name,address, title, description, etc.Is there any way to access this information using AS3 so that, say, captions for images in a flash gallery could be generated automatically?
View 1 Replies
Jan 18, 2010
I have a .flv file that has several images in it. However, I do not have the original images. There is an image in the .flv file that is a transparent image. How am I able to copy and paste it or do whatever I can to transfer it to photoshop so that I can save it as a transparent image?
It appears there is no way to do this. It looks like I must have the original images in a .flv.
View 7 Replies
Aug 3, 2006
I have a series of mc's on the stage: but1, but2, but3 and I have an xml file which leads to an image. I want each button to access the respective image.
This is the code:
[code]...
I think this is the line with the problem var mc = "but"+(i+1);, because when I place but1, the but1 works.
Does anybody know which is the problem, or does anybody know a tutorial?
View 5 Replies
Feb 13, 2009
An image, like a jpeg, has a bunch of metadata stored in it.The "IPTC Core" metadata usually includes the photographers name,address, title, description, etc.Is there any way to access this information using Flash so that, say, captions for images in a flash gallery could be generated automatically?
View 1 Replies
Nov 29, 2009
I am using the default TileList component in AS3/CS4, where a user can upload their images and it is displayed in the TileList by using the URL of the upload as the source parameter.The final piece of the puzzle is knowing the dimensions of the image that was uploaded, but bugger me if I can find how to access each image that is displayed in each cell of the tilelist. I can of course get the dimensions of the cell itself (which of course is always the same for each one), but I want the content of the scaled image within the cell ..
View 5 Replies
Feb 3, 2010
I have a button inside a MovieClip (instance name: bt_fechar) and I want to refer to it from the main timeline (that's where I want to keep most of the code). It returns the following output error message: "Error #1065: Variable bt_fechar is not defined"
Heres the code:
function retirarCiclo(event:MouseEvent):void
{
[code].....
View 1 Replies
Jul 21, 2010
How is it possible to access another movieclip inside a movieclip, if you have it linked to a class in the properties?
like
Code:
function rotateSubclip_():Void
{
this.subclip._rotation += 1;
[Code]....
View 6 Replies
Mar 10, 2011
Trying to develop a Monopoly in Flash/as3, I'm now displaying the properties of each player. When a user clicks on the userpanel, a "popup" appears, in wich all cards are displayed with an alpha = 0. My idea is to set the alpha at 1 for all the properties owned by the targeted user.
So, I have a panel called "panelCards", containing movieclips called "property1", "property2", "property3", ... In my code, an object Player has an array "pProperty", wich contains strings referring to every properties owned. I try to access the moviclips using these strings :
[Code]....
Obviously, it doesn't work. Is there a function wich allows me accessing those movieclips with the string reference?
View 2 Replies
Jun 2, 2010
I want to access a MovieClip in another scene than I'm currently in.
More specific I want to set a TextField to a certain value from a "preloader"-scene. This is for handling totally dynamic language phrases. Maybe this is the wrong way.
I'm loading a XML with language phrases that I want to replace the textfields with.
We could do this by altering all MovieClips, but I think this could be a smart solution, if it's possible! :)
View 1 Replies
Dec 17, 2010
Can't access in other movieclips for example I have my sections "home", "about", "contact" and the labels in the sections When I go inside about and call the contact section to set the text for example _parent.instancename(contact).title.text = "TEST"; this I call inside the about section but doesn't work!
View 2 Replies
Aug 20, 2009
is there a way to access the maintimeline from within a movieclip?
root. doesnt seem to work
View 7 Replies
Oct 13, 2009
Currently I found this code and adapted it to my document
Code:
var myLoader:Loader = new Loader();
var myUrlReq:URLRequest = new URLRequest("web11.swf");
myLoader.load(myUrlReq);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
[code]....
This works if I wanted to load the class "Buttongroup" but I want to load the movieClip 'clipHolder' which is a new instance of buttonclass (with functions applied to it)
View 2 Replies
Mar 18, 2011
I have a main.fla that contains say 1_mc and a 2_mc.
a1_mc has a button, which when clicked runs a function called say clickedButton.
a2_mc has a marker_mc inside it.
When the clickedButton function runs inside a1_mc, I want the slider_mc to go y=20
I know I can access main.fla timeline by
Code:
MovieClip(parent).gotoAndStop("nameOfLabel");
I tried
Code:
MovieClip(parent).a2_mc.marker_mc.y = 20;
but it doesn't work
View 3 Replies
Mar 6, 2009
I am trying to add a child in a movie clip and perform basic operations on the child but I cannot get access to the child.
It loads the child to the movieclip "FLine1MC" but it says FLine1MC.ClipArt1 does not exist when I try to change the x location.
function AddArt1(evt:MouseEvent): void {
var ClipArt1Request:URLRequest = new URLRequest("images/mypic.gif");
var ClipArt1:Loader = new Loader();
ClipArt1.load(ClipArt1Request);
FLine1MC.addChild(ClipArt1);
FLine1MC.ClipArt1.x = 550;
}
Anybody know what's my error?
By that token, is there a way we can check the exact path of an object?
View 2 Replies
Sep 14, 2010
On the first frame I have a string variable called "nextSection". When the user clicks on a menu item on the site then "nextSection" is populated with the name of that section. Later on in the fla I have a movieclip containing various sections for the site. The swf compiles without any problems.
I'm now attempting to make the file smaller and easier to update. Rather than have 8 different movieclips that load images, I thought I would just have the one. I changed the following lines in my fla
PHP Code:
// nested within 2 movie clips (sections.aboutUs)loadImage("aboutUs/mainImage.jpg");//nested within 2 movie clips (sections.outdoorAdvertising)loadImage("outdoorAdvertising/mainImage.jpg");// there are 8 of these in total.
[code]...
I'm now getting the error "1120: access of undefined property nextSection". The variable does not contain anything when the file compiles. Only when the user clicks on a menu item does the variable get filled (ie: if user clicks on the OutDoor Advertising button, the variable contains the string "outdoorAdvertising" which is also a folder in the site directory). I tried to populate it with the name of one of the sections on the first frame ( ie: nextSection:String="aboutUs"; ) just to see if it worked but still got the error.
View 8 Replies
Jan 17, 2009
i have variable a=0 and i want a movieclip that runs to change it to 2, what do i write in the movieclip code ? i tried parent.a=2 but it's error.
View 4 Replies
May 18, 2009
I have a stageand there is a movieClip instance called "obiekt" in it. Inside "obiekt" movieClip there are two other clips. One instance is called "z1" and another one is called "z2". Presume I have a event listener in "z2" what in case of mouse rollover calls a function what is supposed to set "z1" movieClip 'visible' property to true.
Code:
root.obiekt.z1.visible = true;
I get this error:
1119: Access of possibly undefined property obiekt through a reference with static type flash.display:DisplayObject.
View 3 Replies
Sep 13, 2009
I have movieclip its instance name is mc, located in the 9th frame on the main timeline.It has more than one key frame. Inside this movieclip there is a FLVPlayback its instance name is vid which is located in the 9th frame on the timeline of the movieclip. I want to access the FLVPlayback using AS2 and AS3. Here is my code, which is not working:
[Code]....
View 1 Replies
Oct 6, 2009
1. I created empty symble with instance name "picture" and placed it on stage at a wanted position.
2. if the image is aviliable I load the movie picture.loadMovie(image[p]); to show the image
3. if image isnt avliable I want to attach a movieClip that has dynamicText so I can change the text.
picture.attachMovie(mcDef,"mcdef"+p,1000);
this doesnt work - the movieclip is not shown and picture._alpha has no effect. so I tried to load a swf file of this movieclip (this isnt the right way)
picture.loadMovie("mcDef.swf");
it works and picture._alpha has effect
list veriables shows:[code].......
but I cannot access the text.I preffer to use attachMovie and change its text.mcDef.swf is made of rectanglar shape, on top of it dynamicText with instance name m_text. this was converted to a symble with linkage name mcDef .
View 4 Replies
May 28, 2010
I would like to tell a movieclip on the stage to be visible from a class.
View 1 Replies
Feb 28, 2011
I have a problem accessing the inside of movieclip i mean child of the movieclip
the code is here
var myMovie:MovieClip = new MovieClip();
addChild(myMovie);
var myChild:Sprite = new Sprite();
[Code].....
View 3 Replies
Apr 19, 2010
I've been trying to learn Action Script 3 the past few weeks, making tiny interactive games to learn the basics. I stumble upon a problem every now and then but most of the times google helps me out.The main stage contains two objects(movieclips), the player and a wall.The player has got his own code so when I drag in the player object I don't have to write any code into the main stage to be able to move the player.This all worked pretty well and I now wanted to add the wall so the player actually has something to bounce into.Now here is the problem, I want to check if the player touches the wall, I've done this before but that was when I used the main stage as my coding playground instead of putting the code in movieclips. How can I check if the player hits the wall within the movement code of the player object?
View 1 Replies