Advanced Search

Results 1 to 2 of 2

Thread: How insert URl in this script ...

  1. #1
    Join Date
    Dec 2006
    Location
    Conshohocken, PA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How insert URl in this script ...

    function init()
    {
    this[1].pressed = 0;
    this.stopDrag();
    this.attachMovie("loading", "loading", 10000);
    screen.original.loadMovie(url + "image/image1.jpg");
    this.onEnterFrame = function ()
    {
    if (screen.original.getBytesTotal() == screen.original.getBytesLoaded())
    {
    this.loading.removeMovieClip();
    screen.gotoAndPlay(2);
    delete this["onEnterFrame"];
    } // end if
    };
    check.target = 1;
    check.onEnterFrame = function ()
    {
    this._x = this._x + (this._parent[this.target]._x - this._x) / 4;
    this._y = this._y + (this._parent[this.target]._y - this._y) / 4;
    };
    } // End of the function
    _global.numOfImage = 20;
    url = "";
    temp = 10;
    check.swapDepths(20000);
    var i = 1;
    while (i <= numOfImage)
    {
    mc = this.attachMovie("btn", i, i + 100);
    mc._x = (i - 1) % temp * 75 + 30;
    mc._y = Math.floor((i - 1) / temp) * 46 + 450;
    mc.oldx = mc._x;
    mc.oldy = mc._y;
    mc.point.loadMovie(url + "thumb/image" + i + ".jpg");
    mc.onRollOver = function ()
    {
    this.fade.play();
    check.target = this._name;
    check.onEnterFrame = function ()
    {
    this._x = this._x + (this._parent[this.target]._x - this._x) / 4;
    this._y = this._y + (this._parent[this.target]._y - this._y) / 4;
    };
    };
    mc.onRelease = function ()
    {
    this._parent.attachMovie("loading", "loading", 10000);
    screen.original.loadMovie(url + "image/image" + this._name + ".jpg");
    this._parent.onEnterFrame = function ()
    {
    if (screen.original.getBytesTotal() == screen.original.getBytesLoaded())
    {
    this.loading.removeMovieClip();
    screen.gotoAndPlay(2);
    delete this["onEnterFrame"];
    } // end if
    };
    };
    i++;
    } // end while
    init();

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Your url= here:

    Code:
    _global.numOfImage = 20;
    url = "";
    temp = 10;
    Needs to be a global variable.

    Something like this:

    Code:
    _global.numOfImage = 20;
    _global.domainName = "http://dynamicdrive.com";
    temp = 10;
    Then when ever you call it and need to add folders or pages or other variables you would do something like:

    Code:
    on(release){
    	getURL(_global.domainName+"/forums/", "_blank");
    }
    (in the case of on a button here)

    or to use your script:

    Code:
    screen.original.loadMovie(_global.domainName + "image/image" + this._name + ".jpg");
    just be careful where you put your folder separators. For instance in the variable definition, if you use http://dynamicdrive.com/ then when you add folders in your ActionScript DON'T start the folder name with a / (like /forums/ ) just use "forums/"

    Hope it helps
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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