ActionScript 3.0 :: Address Sprite From Within .as File

Nov 12, 2009

(1120: Access of undefined property images) For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask. My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite "images". imageHolderArray[i]=new InfoText (xmlName) images.addChild(imageHolderArray[i]) imageHolderArray[i].name=xmlName; The InfoText get's the name of an xml file, then starts to load this xml file, populates text fields with it, etc. Work fine! If the heigth of my textContainer sprite (create in InfoText.as) is taller than the display height, InfoText.as adds a scrollbar (Scrollbar.as, extends) var scrollbar = new Scrollbar (xmlName,size,height) addChild(scrollbar) scrollbar.name="scrollbarClass" I pass on the xmlName to be able to address the correct sprite.

The scrollbar itself work fine (moving the slider), too, BUT I'm not able to move my text container. I tried stuff like Sprite(images.getChildByName(xmlName).textContainer).y=posY and so on. But even images.visible=fasle won't work from within Scrollbar.as. Usually it is a 1120: Access of undefined property images. The target path displayed when I list all objects is as follows: image=0 target="_level0.portfolio.images.EXHIBITIONS.scrollbarClass.scrollbar and for the textContainer image=0 target="_level0.portfolio.images.EXHIBITIONS.textContainer Exhibitions is an example of what may be the content of the xmlName. So, how do I point my line of code responsible for moving the textContainer from within Scrollbar.as at the textContainer sprite? Running against a wall since the last 6 hours and couldn't find any proper tips on the web.

View 14 Replies


Similar Posts:


ActionScript 3.0 :: Address Sprite From Within .as?

Nov 12, 2009

Basically I guess it is a reference problem I do have. (1120: Access of undefined property images)

For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask.

My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite "images".

imageHolderArray[i]=new InfoText (xmlName)
images.addChild(imageHolderArray[i])
imageHolderArray[i].name=xmlName;

[Code]...

View 6 Replies

Flash :: Address The As File From Another Folder?

Jul 20, 2011

I usually work with many AS files in the same folder and it is easy to address those files to each other. But I now have a sub folder inside the name folder which stores most of my files; and there is another as file inside that sub folder. How can I change variables of the AS file(inside the sub folder) from the AS files from the main folder and vice verses.

View 1 Replies

Get Logo To Appear Next To The Address When Website Address Is Typed In

Jul 14, 2009

how to get your logo to appear next to the address of your web site when your website address is typed in,
for example if you look at the website address at the top of the screen you see (logo) [URL]

View 1 Replies

ActionScript 2.0 :: Pulling URL Address From External Txt File?

Sep 11, 2009

I'm trying to pull an URL from a txt file, but apparently the URL itself contains several "&" signs which are used to separate variables, so now when I click on the link I'll only get the first segment of the link. Is there a way to go around it?

View 1 Replies

Professional :: .swf File Is Not Working With Localhost Address?

Sep 13, 2010

My .swf file is not working on localhost. But when we try to run it directly from the file location then it is running.

View 1 Replies

ActionScript 3.0 :: Adding Timestamp To XML File Address

Oct 12, 2011

I'm trying to add timestamp to the xml file address if the swf wil be loaded from the web server but it gives me a null object reference error depending on if there is timestamp() function call or not.

Here's my code that doesn't work as I was expecting:
ActionScript Code:
//...
public function init():void {
try {
xmlLoader = new URLLoader();
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioError);
[Code].....

When I load just addresses without the timestamp xmlLoader.load(new URLRequest(address)); it outputs everything I was already expecting when the timsetamp function call where involved, (as I was testing some considerable errors).
Code:
Class LoadXML/ address: start.xml
Class LoadXML/ address: play.xml
Class LoadXML/ address: end.xml
Class LoadXML/ io error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: file:///E|/flash/as3/projectName/lib/work/end.xml"]

View 4 Replies

ActionScript 3.0 :: Linking To Content - Go To The File Via The FTP Address And Access It

Jan 25, 2009

I am building an e-learning module and including a movie. I have uploaded the move to an FTP site, and am now trying to find the URL of the file, but I cant. I am new to this so I'm sure I'm doing something wrong but I cant figure out what it is I am trying to use [URL] I can go to the file via the FTP address and access it that way, but not via the HTTP rout

View 3 Replies

ActionScript 3.0 :: Save Email Address To File In Facebook

Jan 15, 2011

I'm a newbie in actionscript and I'm developing a flash game for facebook. The issue is that I want to save the e-mail address introduced by the player to a txt file.

View 0 Replies

IDE :: Referencing Sprite From Within .as File

Nov 12, 2009

Basically I guess it is a reference problem I do have. (1120: Access of undefined property images) For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask. My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite "images".

[Code]...

So, how do I point my line of code responsible for moving the textContainer from within Scrollbar.as at the textContainer sprite? Running against a wall since the last 6 hours and couldn't find any proper tips on the web.

View 5 Replies

ActionScript 1/2 :: Check If Email Address Is A Legitimate Email Address?

Nov 20, 2009

How do I check if email address is a legitimate email address? Is there any possibility in that?

View 7 Replies

Flash :: Address A Named Instance Of A Movieclip From The Class File Of The Movieclip?

Jun 1, 2011

I have a movieclip instance named 'placeholder' on the canvas, and I want to change the alpha of the named movieclip from it's class without effecting the alpha of all the movieclips of the same type. How would I specifically target the named movieclip instance that is on the canvas?

View 3 Replies

Flash :: Converting Sprite Based SWF File To Mxml

Jan 10, 2012

I wrote a big Actionscript project using AS3 as an "Actionscript Project" in Flash Builder 4.5. I have a bunch of solid, reusable, code, but one of the big components is a main.as file that extends Sprite and serves as the display code for my application. I now, for various reasons, need that to be a Flex application. I'm trying to get the most minimal wrapper possible, so here's what

[Code]...

View 2 Replies

Flash :: AS 3.0 - AddChild Of A Sprite Thats Defined On A Class In A .as File?

Feb 6, 2012

I have defined some sprites in a class .as file and I want to put them in the screen. How can I do this?

View 2 Replies

ActionScript 3.0 :: Sprite Not Loading Onto Stage From Class File

Sep 21, 2011

For the life of me I can't work out why this script is not working: In the library are two movieclips: pink_sprite and green_sprite each of which has a attached class pinkSprite and greenSprite. These classes in turn are extenders of the hitTest.as class below.

[Code]...

View 3 Replies

Actionscript 3 :: Class Extending Sprite - Set The Sprite's Width And Height Properties?

Mar 5, 2010

I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.

What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.

package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....

View 1 Replies

Flash: `sprite.visible = False` Doesn't Hide Sprite Immediately?

Apr 4, 2011

I've got a sprite which I want to temporarily hide... But changing the .visible property doesn't do what I expect. The code looks roughly like this:

[Code]...

View 1 Replies

IDE :: Adding A Single Sprite On Main Moviclip Sprite Remains Invisible

Mar 2, 2009

I created a new AS3 document (550px by 400px) and added the following code to the first frame.

However, when I run this, I see nothing painted on the screen at all, the screen remains completely white.[code]...

View 3 Replies

Flash :: Rotating Sprite Moves The Sprite From It's Original Location

Jul 6, 2011

I'm doing a simple rotation on a sprite but there's a weird behavior where the sprite does not rotate around it's top left. I think I'm rotating along the top left of the test class instead of the sprite child. I would like to rotate the rectangle around it's top left corner (kinda like a clock hand). The code is pretty short so I'll let the code + pictures explain my problem:

package
{
import flash.display.Sprite;

[Code]....

I've read a lot of stuff about rotating around a fixed point, I've tried doing it with movieclips instead of sprites, I even copy pasted a tutorial on rotation and nothing works.

View 3 Replies

ActionScript 3.0 :: Sprite.addChild(NumericStepper) Resizes Sprite To 100x100

May 27, 2008

[Code]...

Then the numericStepper is drawn as if it is squished to 20% its normal height. If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all. Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?

View 2 Replies

ActionScript 3.0 :: Gallery - Loading Thumbs From An Xml File And Placing Them Into One Container (sprite)

Jan 31, 2009

I am loading thumbs from an xml file and placing them into one container (sprite), which i later use for scrolling based on mouse position with this formula:

[Code]...

View 3 Replies

Actionscript 3 :: Difference Between Sprite.width VS Sprite.scaleX?

Sep 23, 2011

Both of sprite.width and sprite.scaleX can be used for scale a sprite. Is possible sprite.scaleX depends on screen size?

View 2 Replies

ActionScript 3.0 :: Sprite.graphics And Setting Sprite.width?

Jun 19, 2009

It has been a great resource of the years. No my problem. I am trying to dynamically resize a sprite that has a line drawn into it. Here is my code:

[Code]...

View 4 Replies

ActionScript 3.0 :: Mcproduct Sprite And Mcproductpane Sprite?

Aug 15, 2010

first i have 2 sprite.. it`s mcproduct sprite and mcproductpane sprite . mcproductpane is a parent of mcproduct sprite.. so inside mcproductpane there a several mcproduct sprite.this is a script of mc prodcut

PHP Code:

[Code]...

The problem is i want to set a button in here(mcproductpane sprite), this button will unload / make dissappear an image that i load using loader class in mcproduct sprite..how can i make this happen?when i want to make a button in mcproductpane sprite which the function of the button it`s to unload/make an image that i load using loader class in mcproduct sprite disappear.

View 1 Replies

Actionscript 3 :: Drawing - Cut A "hole" Inside A Rectangular Sprite To See The Sprite Underneath?

Feb 3, 2010

Everytime I google this question I see confusing information about masks and blends, none of which seems to directly apply to what I think should be an easy thing... There are three Sprites involved here...the lowest layer sprite is pretty much a background. I want to overlay a translucent Sprite on top of the background and then I want the third, top-most Sprite to act as a hole, so that the area inside the third Sprite is completely transparent, so that the background sprite is completely visible. How would I go about doing this dynamically (i.e. dynamically drawing the masking sprite and hole using the Actionscript graphics calls)?

View 4 Replies

ActionScript 3.0 :: Set The Height Of The Sprite Depending On The Height Of An Textfield Inside That Sprite?

Feb 2, 2009

Is it possible to set the height of the sprite depending on the height of an textfield inside that sprite? I'm creating a box with a textfield inside it, but I want the box to be sized depending of how much text it is in the textfield..

View 9 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It?

Mar 23, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

at flash.display:isplayObjectContainer/removeChild()
at grid/ball_movement()// my function in enter frame event
The code I wrote in ENTER_FRAME is

[code].....

View 3 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It

Mar 24, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.[code]

View 1 Replies

ActionScript 3.0 :: Which Sprite Is Another Sprite Over

Feb 5, 2009

Ive got a question that feels like it should be easy but I cant figure it out. Suppose I have 2d grid of square sprites on the stage, lets say 20 by 20 (400 sprites). Another sprite moves accross the stage on top of the grid. The moving sprite and the 400 sprites below it share a common parent. So heres the question: How do I find out which of the 400 sprites the moving sprite is currently over? And heres an extra wrinkle: I lied, the sprites are not square they are of differing shapes so I cant do a simple math calculation.

All I can come up with is something like hitTestPoint(), but then I would have to call it 400 times wouldnt I? That is probably the most inefficient way to do things. Is there a function like whatsUnderThisPoint(p : Point) which will return a list of every sprite on the display list that contains p?

View 3 Replies

Professional :: Get The Address Of The Pic?

Apr 22, 2010

I got a problem,how can i get the addressof my pic?? 

imgLoader.load(new URLRequest("abc.jpg"));
 
for example, address fo "abc.jpg" is D:work_folderabc.jpg

how can I trace this information??

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved