dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] [F8] Actionscript help with symbol control

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    4

    resolved [RESOLVED] [F8] Actionscript help with symbol control

    I have a bunch of symbols on the stage and want to control them with actionscript to cut down on the workload. Below is what I've created that works for the most part with 3 problems/customization desires:

    1) When I test this the POST still sends my variables in a querystring like a GET (only read by request.querystring). How to make the POST act like a POST.
    2) My mouse over creates a larger symbol. How could I get this to animate the growth to a larger symbol?
    3) My shadow effect is just a transparent copy of the original symbol. How can I change the color to be transparent black? Or is there a better way?

    for (var i in this){
    if (typeof (this[i]) == "movieclip"){
    this[i].onRelease = function (){
    var myVars:LoadVars = new LoadVars();
    myVars.symbolName = this._name;
    myVars.CatID = -1;
    myVars.OtherStaticVar = -1;
    myVars.send("http://myLocalPCname/test.asp", "_self", "POST");
    }
    this[i].onRollOver = function (){
    this.swapDepths(100);
    this._x -= this._width/2;
    this._y -= this._height/2;
    this._xscale = 200;
    this._yscale = 200;
    this.duplicateMovieClip("shadow_mc", 99);
    shadow_mc._x = this._x -10;
    shadow_mc._y = this._y +10;
    shadow_mc._alpha = 50;
    }
    this[i].onRollOut = function (){
    this.swapDepths(0);
    this._xscale = 100;
    this._yscale = 100;
    this._x += this._width/2;
    this._y += this._height/2;
    shadow_mc.removeMovieClip();
    }
    }
    }

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    4
    The following is courtesy of clbeech on another forum:

    1) you should use LoadVar.sendAndLoad - rather than just send in order to maintain the current swf file - even if you only specify a "POST" method param.

    2) you should use the Tween class to 'grow the scale of the button - and shrink back to size it onRollOut - without a need to create a duplicate instance.

    3) you should use the DropShadowFilter to achieve this with code

    so this should look like:

    Attach Code

    import flash.filters.DropShadowFilter;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;

    for (var i in this){
    if (typeof (this[i]) == "movieclip"){
    this[i].onRelease = function (){
    var myVars:LoadVars = new LoadVars();
    myVars.symbolName = this._name;
    myVars.CatID = -1;
    myVars.OtherStaticVar = -1;
    myVars.sendAndLoad("http://myLocalPCname/test.asp", myVars, "POST");
    }
    this[i].onRollOver = function (){
    this.swapDepths(100);
    this.filters = [ new DropShadowFilter(10, 45, 0x000000, 0.5, 4, 4)];
    new Tween(this, '_xscale', Strong.easeOut, this._xscale, 200, 10, false);
    new Tween(this, '_yscale', Strong.easeOut, this._xscale, 200, 10, false);
    }
    this[i].onRollOut = function (){
    this.swapDepths(0);
    this.filters = null;
    new Tween(this, '_xscale', Strong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center