[Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Mendelsohn, Michael
Hi list... [finally migrating to AS3] What would be a good way of going about having many sprites move across the screen at different rates? I have a random number (0-5) that I want to use as a coefficient for each sprite's speed. My thought is to base the movement off of Timer events

[Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread Ali Drongo
Hi there, I'm passing a variable to my swf through a query string like this: htp://www.mydomain.com/index.html?passedPage=180 I have my main AS2 class that is the root class and have tried to access the variable like this: trace(PASSPAGE SET:+this[passedPage]);

Re: [Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread Juan Pablo Califano
I think you're passing the vars to the html page, but not the swf. You can use flashvars or just append a querystring to the swf url and you should be able to trace them Cheers Juan Pablo Califano. 2008/12/16 Ali Drongo alidro...@googlemail.com Hi there, I'm passing a variable to my swf

Re: [Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread Nate Beck
http://www.mydomain.com/index.html?passedPage=180 This won't pass into flash as a flashvar. You have a few options though. - Use Javascript to grab the query string and then write it in as a flashvar or query string to the swf. (ex: MySwf.swf?passedPage=180 - Make an ExternalInterface

RE: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Cor
Why use a timer? It is not necessary to do it on exact time because you use a random. So in this case Event.ENTER_FRAME would do the trick for you. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of

Re: [Flashcoders] Re: A funny little hover problem with CSS

2008-12-16 Thread Jon Bradley
On Dec 14, 2008, at 8:04 PM, Ashim D'Silva wrote: Right. I recreated everything slowly in a new file, introducing things one by one and here's the culprit - Advanced Anti-Aliasing.Now I really would like to use advanced, because text looks dramatically better, but there has to be a

Re: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Nate Beck
Without getting too technical, you don't want to use timers move things. You want to use frames instead of timers. Save yourself some headache and don't use timers for movement. (unless you're using them to invalidate properties and such, but that's a more complex topic) Now if you want the

[Flashcoders] problem with loadMovie

2008-12-16 Thread Alexander Böhm
Hi there, can anybody tell me why the second line of code given here, loads the image perfectly into the holder-clip, and the other method won't work? ActionScript Code: _root[clicked_Button].picholder_mc.loadMovie(getPlayerInfo(surname, _root[this._name].name_txt.text).toLowerCase() +

RE: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Cor
addEventListener(Event.ENTER_FRAME, onEnterFrame); function onEnterFrame(event:Event):void { ball1.x += Math.round(Math.random()*5); ball2.x += Math.round(Math.random()*5); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread whispers
You can also use SWF Object to embed the movie... I believe you have the options or grabbing vars form the query string. Makes it quite easy: The SWFObject script also comes with an extra function which allows you to pull variable values from the url string. An example is you have a url that

RE: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Mendelsohn, Michael
In AS2, I would have made a component with a parameter for speed. I'm just not sure how to do that in AS3, so I was guessing with a timer, I could add and event listerner to dispatch an event to the target, but I guess not. Thanks! - MM -Original Message- From:

Re: [Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread Nate Beck
Hey that's cool, I didn't know that existed. Thanks whispers! -- Cheers, Nate http://blog.natebeck.net On Tue, Dec 16, 2008 at 9:08 AM, whispers whispers...@hotmail.com wrote: You can also use SWF Object to embed the movie... I believe you have the

RE: [Flashcoders] How to access var passed in URL from AS2 class

2008-12-16 Thread whispers
No problem.. SWF Object is a GREAT way to embed your flash movies into HTML (or whatever).. It allows for a lot for other stuff as well.. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nate Beck Sent:

RE: [Flashcoders] problem with loadMovie

2008-12-16 Thread whispers
Have you tried tracing out: _root[clicked_Button] And see what it returns to ensure that it is correctly giving you the data you need? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Alexander Böhm Sent:

Re: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Glen Pike
Hi, You can still make a component to do this. I would recommend extending the Sprite / MovieClip class as your custom component. Add a variable called speed and add an Enter Frame handler to your code, then in there, work out your next position based on the speed. It would be a

[Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Mendelsohn, Michael
Wow, AS3 is different, even after reading Moock's book. I'm sure this is an easy question: How do you reference sprites within a sprite in an event listener? I have a child allcolumns within a sprite. Within allcolumns are 50 columns (sprites), each named column1, column2, etc. Allcolumns has

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Taka Kojima
Hey Michael, seeing as you can't create Sprites on the timeline, the following won't work because your sprites don't have instance names. Thus when you are creating your sprites, you have to add them all to an array. i.e. var columns:Array = new Array(); for(var i:int = 0; i = 50; i ++){ var

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Ian Thomas
If each of the columns has .name='column1' etc: e.target.getChildByName(column10).gotoAndStop(5); should do it. But personally I'd at least do some type-checking on all that, and would probably create a method inside an AllColumns class to handle changeChar(). (Obviously I don't know what

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Anthony Pace
isn't getting a child by name very slow? Ian Thomas wrote: If each of the columns has .name='column1' etc: e.target.getChildByName(column10).gotoAndStop(5); should do it. But personally I'd at least do some type-checking on all that, and would probably create a method inside an AllColumns

RE: [Flashcoders] referencing sprites within a sprite (AS3 newbiequestion)

2008-12-16 Thread Mendelsohn, Michael
Thanks Ian. That's the method I'm looking for, but can it work two levels deep? I'm really looking to change one MovieClip within each of these columns. Here's the code: private function changeChar(e:Event):void { var newFrame:uint = Math.random()*50; var whichColumn:uint =

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Eric E. Dolecki
.currentTarget ? On Tue, Dec 16, 2008 at 4:51 PM, Ian Thomas i...@eirias.net wrote: Yes. However, it was the simplest answer to Michael's question. I'm afraid I didn't (and still don't) have time to answer the question with a long 'here's how I'd actually do it and why it's a good idea

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Matt S.
So as a general question, what is the preferred method if you're trying to get, say, dynamically generated children, eg image1image20 etc, from a container? .m On Tue, Dec 16, 2008 at 4:51 PM, Ian Thomas i...@eirias.net wrote: Yes. On Tue, Dec 16, 2008 at 9:08 PM, Anthony Pace

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Taka Kojima
I use the method I gave you earlier, adding elements to an array and accessing them that way. Also, you can use getChildAt() if you know the index of the children, which it sounds like you do if you have them named as you do... i.e. column1, column2, column3 On Tue, Dec 16, 2008 at 2:17 PM, Matt

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Ian Thomas
On Tue, Dec 16, 2008 at 10:57 PM, Taka Kojima t...@gigafied.com wrote: I use the method I gave you earlier, adding elements to an array and accessing them that way. As do I. Ian ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] Timer (AS3 newbie question)

2008-12-16 Thread Taka Kojima
I'd say look into TweenLite, it supports tween delay and tween length which I think would solve your problem and also wouldn't entail having to deal with a bunch of ENTER_FRAME event listeners. - Taka On Tue, Dec 16, 2008 at 10:20 AM, Glen Pike postmas...@glenpike.co.ukwrote: Hi, You can

Re: [Flashcoders] Re: A funny little hover problem with CSS

2008-12-16 Thread Ashim D'Silva
Wow. Thanks. I wouldn't have thought rotating a text field would make it better. Whenever I need to rotate text I usually render it to a bitmap and rotate that. Help is much appreciated. Ashim 2008/12/17 Jon Bradley jbrad...@postcentral.com On Dec 14, 2008, at 8:04 PM, Ashim D'Silva wrote:

Re: [Flashcoders] Re: A funny little hover problem with CSS

2008-12-16 Thread Taka Kojima
I think I know the solution It's quite a different approach... but a lot of times text has shifting problems on hovers and whatnot when their x,y's are not set at exact pixels. Maybe try changing the positioning on the stage so that the elements use an exact x,y value, or do a Math.round()

Re: [Flashcoders] Re: A funny little hover problem with CSS

2008-12-16 Thread Taka Kojima
p.s. make sure all of the textfield's parents also have their x,y values as whole pixels. -Taka On Tue, Dec 16, 2008 at 4:18 PM, Taka Kojima t...@gigafied.com wrote: I think I know the solution It's quite a different approach... but a lot of times text has shifting problems on hovers

Re: [Flashcoders] inversedMask method stopping any parent masks?

2008-12-16 Thread -whispers-
Sorry I think the URL to the original method and subsequent posts about my problem was alittle messed up.. appreciate it if ANYONE could get this working..or at leasttell me its not even possible in Flash. Thanks correct url:

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Ian Thomas
Yes. However, it was the simplest answer to Michael's question. I'm afraid I didn't (and still don't) have time to answer the question with a long 'here's how I'd actually do it and why it's a good idea not to refer to nested clips like this' email, unfortunately. :-) It was a quick fix for

Re: [Flashcoders] referencing sprites within a sprite (AS3 newbie question)

2008-12-16 Thread Matt S.
I wasnt actually the original question-asker, but thanks :) I was just curious about the actual performance hit from getChild. .m On Tue, Dec 16, 2008 at 5:57 PM, Taka Kojima t...@gigafied.com wrote: I use the method I gave you earlier, adding elements to an array and accessing them that way.

Re: [Flashcoders] Re: A funny little hover problem with CSS

2008-12-16 Thread Ashim D'Silva
I always round everything I place. That was one of the first things I checked. Rotated bitmaps and text often have this problem, which is fair enough because half pixels don't exist. Cheers though. 2008/12/17 Taka Kojima t...@gigafied.com p.s. make sure all of the textfield's parents also have