It sounds like you're replacing the document class for some reason. Which,
most often, is indeed a singleton. Although I normally aim towards it being
static for all intents and puposes, and use that as my central information
source for passing around shared assets/code etc.Tell me if I'm
Hi cool list.
In the following piece of code, I cannot make the type of the parent reference
to DisplayObject. If I set the reference-type to *, all works fine. But there
must be a more sophisticated way that produces cleaner code.
Anyone?
Code:
public class Test extends Sprite
{
Sander,
.parent is of type DisplayObjectContainer, not DisplayObject. Only
DisplayObjectContainers have the .addChild() method.
If you use DisplayObjectContainer as r's type, it should all work fine.
HTH,
Ian
On Wed, Dec 3, 2008 at 12:06 PM, Sander Schuurman
[EMAIL PROTECTED] wrote:
Hmm...I'm not sure what you mean by static class. Are you saying that
the other classes I instance via composition in my singleton should
themselves be static?
- MM
Why aren't you using a static class for that instead of a Singleton?
Mendelsohn, Michael wrote:
Thanks for the responses
Hello List,
I have been forced to go back to AS2 recently for a work project and oh my
is it annoying me.
Part of the project I am writing a simple advertising loader, its basically
just a swf that loads other swfs into it.
The problem is that the adverts that are loaded in sometimes contain
Mike,
A mask (as defined by setMask()) isn't a visible object, so you
can't apply clicks to it like that. setMask() is used for clipping
areas of a movieclip (like looking at the movieclip through an
irregularly-shaped window).
A better bet would be either to apply the onRelease/onMouseDown
Hi,
Use a transparent clip over the top rather than making a clip a mask
for your loaded clip - that should intercept mouse clicks, not sure a
mask will?
Glen
mike cann wrote:
Hello List,
I have been forced to go back to AS2 recently for a work project and oh my
is it annoying me.
Okay well setting these values:
mask.onMouseUp = Delegate.create(this, advertClickthrough);
mask.onRelease = function() { }
mask.onPress = function() { }
mask.onMouseDown = function() { }
mask.onMouseMove = function() { }
to
_mc.onMouseUp =
I forget but doesn't the _mc.enabled property cascade downwards? So once
loaded you could set the container for the loaded swf as enabled = false...
?
On Wed, Dec 3, 2008 at 9:07 AM, mike cann [EMAIL PROTECTED] wrote:
Hello List,
I have been forced to go back to AS2 recently for a work
On Wed, Dec 3, 2008 at 2:34 PM, mike cann [EMAIL PROTECTED] wrote:
Okay well setting these values:
mask.onMouseUp = Delegate.create(this, advertClickthrough);
mask.onRelease = function() { }
mask.onPress = function() { }
mask.onMouseDown = function() { }
Hi,
You need a separate clip to attach the mouse handlers too - not the
loaded clip, but another transparent one over the top of this - you
probably need something in the mousetrap clip with an alpha of 0 to
make this work.
Glen
mike cann wrote:
Okay well setting these values:
Hi,
I think enabled only applies to the clip, not it's children.
Glen
jonathan howe wrote:
I forget but doesn't the _mc.enabled property cascade downwards? So once
loaded you could set the container for the loaded swf as enabled = false...
?
On Wed, Dec 3, 2008 at 9:07 AM, mike cann
setting _adContainter.enabled = false; doesnt work. (this is the one that
contains the loaded swf);
I have tried using MovieClipLoader and then doing the masking and the event
listening after the load too
If you would like i can do you an example with that method too.
I have tried making a
Okay the mousetrap over the top doesnt work. Find the new example here:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare_MouseTrap.zip
Source output here:
private function loadAdvert(advertURL:String)
{
// Make a mask for those naughty ads that dont mask
var mask :
Okay i have now tried the mc.enable approach and still the clicks are
getting through?
Download this example here:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare_Enable.zip
Source below:
private function loadAdvert(advertURL:String)
{
// Make a mask for those naughty ads
Use the (very) old invisible button trick.
So create a Button symbol with only the hit state (keyframe) defined and put that on top of the movieclip that holds the loaded
swf.
- Original Message -
From: mike cann [EMAIL PROTECTED]
To: Flash Coders List
Hi Mendelshon,
You shouldn't use a singleton to take off, just use that main document
class to take of !
The main Document class is automatically your main stage as a MovieClip
- Displayobject.
That is always a static class and is a Singleton by itself I gues
becuase you only van have 1 stage
One very annoying feature of CS4 is the lack of a local help panel -
pressing F1 now takes you to the Adobe website for context sensitive
help...and browsing around is slow because you have to wait for every page
load...and there is no way to simply browse using a tree as you could in
CS3.
One
I am using compc to compile a swc with the classes I need in it.
The problem is, when I inspect the swc the formal parameter names in the
method declarations are showing as XXX and not what they are coded as.
Does anyone know how I can change this?
Thanks in advance,
Eamonn
Hi Muzak,
I have just tried this and still get the error.
Screenshot of error:
http://www.mikecann.co.uk/DumpingGround/AS2_Problem01.png
Example Code:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare_SneakyButton.zip
Also there is another problem. If you click outside of the masked
The error is likely due to your sandbox situation. If you test the site
online you'll likely see the error go away. In order to fix it locally
you'll have to add your desktops work folder to your trustes sites list in
your flash player preferences.
Hi,
How could I convert a bitmap to a binary-coded bitmap ... or anything
else that will represent a binary-coded image ?
Thanks
L
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
If you mean 'how do I encode a bitmap into an image format' e.g. PNG
or JPEG, check out this library:
http://code.google.com/p/as3corelib/wiki/Main
which has code for both PNG and JPEG.
HTH,
Ian
On 12/3/08, laurent [EMAIL PROTECTED] wrote:
Hi,
How could I convert a bitmap to a
Also Flex supports PNG and JPEG:
mx.graphics.codec.PNGEncoder and mx.graphics.code.JPEGEncoder.
Dave
On 12/3/08, Ian Thomas [EMAIL PROTECTED] wrote:
If you mean 'how do I encode a bitmap into an image format' e.g. PNG
or JPEG, check out this library:
No it's more like to obtein a treshold image...I just read that in a
publication, in a book...
The reason why the input image is converted to a binary-coded image is
because binary-coded image requires less data size than color or BW image.
get not more clue with google :)
L
David
Really? Wow. Must be new additions - excellent.
Ian
On 12/3/08, David Hershberger [EMAIL PROTECTED] wrote:
Also Flex supports PNG and JPEG:
mx.graphics.codec.PNGEncoder and mx.graphics.code.JPEGEncoder.
Dave
On 12/3/08, Ian Thomas [EMAIL PROTECTED] wrote:
If you mean 'how do I
If you're just after the look the TweenFilterLite library has a great
inbuilt filter. But if you actually want to convert it, I imagine you'd just
run through every pixel and if the value (calculated however you'd like) is
greater than your decided threshold, make it white, else black. I'm not
Yeah, the invisible buton trick won't do in this case (only just now looked at
the zip file).
Looks like the loaded swf listens for Mouse Events.
An overlaying invisible button will only work to prevent underlying buttons
from working.
I'm not sure if there's a way to 'hijack' those mouse
Hi,
BitmapData class has a threshold method that does what Ashim mentioned which
if you were to go to the extreme 0 and 255 of a pixel value you'd ultimately
obtain a black and white image anyway. Main use of thresholding however is
for image processing purposes which I will not go in depth here
29 matches
Mail list logo