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 clicks
within them so without access to the source code i need a method of
preventing those clicks from happening.

To my knowledge this should be doable by implementing a cover over the top
of the loaded swf with a onPress, onRelease etc functions defined correct?

Well for some reason this isnt happenining.

See the source output below. You can download the project here:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare.zip


import flash.geom.Matrix;
import mx.controls.Loader;
import mx.utils.Delegate;
/**
 * ...
 * @author DefaultUser (Tools -> Custom Arguments...)
 */
class GJAdJacket
{
    // Privates
    private var _mc : MovieClip;
    private var _adContainter : MovieClip;
    private var _sizeWidth:Number;
    private var _sizeHeight:Number;

    public function GJAdJacket(attachToMC:MovieClip)
    {
        // The MC we are to attach to
        _mc = attachToMC;

        // Set the stage scale modes
        Stage.scaleMode = "noScale";
        Stage.align = "TL";

        // Init
        _sizeWidth = 300;
        _sizeHeight = 250;
        loadAdvert("
http://gjacket-images.adbureau.net/gjacket/_clientcreative/Eidos/BattleMail021208.swf
");
    }

    private function loadAdvert(advertURL:String)
    {
        // Make a mask for those naughty ads that dont mask
        var mask : MovieClip = _mc.createEmptyMovieClip("mask",
_mc.getNextHighestDepth());
        mask.beginFill(0, 255);
        mask.moveTo(0,0);
        mask.lineTo(_sizeWidth,0);
        mask.lineTo(_sizeWidth,_sizeHeight);
        mask.lineTo(0,_sizeHeight);
        mask.lineTo(0,0);
        mask.endFill();
        _mc.setMask(mask);

        mask.onMouseUp = Delegate.create(this, advertClickthrough);
        mask.onRelease = function() { }
        mask.onPress = function() { }
        mask.onMouseDown = function() { }
        mask.onMouseMove = function() { }

        _adContainter = _mc.createEmptyMovieClip("container",
_mc.getNextHighestDepth());
        _adContainter.loadMovie(advertURL);
    }

    public function advertClickthrough()
    {
        getURL("http://www.google.com";, "_blank")
    }
}


Cheers.

-- 
Mike Cann
http://www.mikecann.co.uk/
http://www.artificialgames.co.uk/
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to