Loading external movies

This is a discussion on "Loading external movies" within the Flash & Multimedia Forum section. This forum, and the thread "Loading external movies are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 5th, 2007, 17:49
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Loading external movies

I've created (with help) a series of buttons that scroll a movieClip's x-position according to an arrayIndex. With variables, these buttons also cycle through their up and down state as the user clicks from one to the next. I'd like for them to also load an external flash movie into a "loader" movie clip. More precisely, a different external swf for each button.

I don't know how to include the loadMovie script into the (beyond my skills) action script that controls my x-postion buttons. I've tried to write the bellow code for each button, but it stops my x-position scroll.
Code: Select all
controller_mc.but1.onRelease = function() {
    loadMovie("chapterTest.swf", "_root.loader");
};
I know this is not vert clear. Here is my complete code.
Code: Select all
//finds current x pos and sets speed to new x pos
Movieclip.prototype.scrollme1 = function(xPos) {
    cX = this._x;
    difX = cX-xPos;
    this._x = cX-(difX/5);
};
Movieclip.prototype.scrollme2 = function(xPos) {
    cX = this._x;
    difX = cX-xPos;
    this._x = cX-(difX/6);
};
//the three timline arrays
//variable starting value
arrayIndex = 0;
//timeline stopping postions
timeline1Xpos = new Array(2800, 2100, 1400, 700, 0, -700, -1400, -2100, -2800);
//scrolling animation
timeline1.onEnterFrame = function() {
    this.scrollme1(timeline1Xpos[arrayIndex]);
};
//variable starting value
arrayIndex = 0;
//timeline stopping postions
timeline2Xpos = new Array(2800, 2100, 1400, 700, 0, -700, -1400, -2100, -2800);
//scrolling animation
timeline2.onEnterFrame = function() {
    this.scrollme2(timeline2Xpos[arrayIndex]);
};
//buttons that scroll the timeline to specific x positions
//but1,2,3,4,5,6,7,8, all here
for (var i = 1; i<=8; i++) {
    controller_mc.but1.gotoAndStop("down");
    controller_mc["but"+i].i = i;
    controller_mc["but"+i].onRollOver = function() {
        this.frameHold = this._currentframe;
        this.gotoAndStop("over");
    };
    controller_mc["but"+i].onRollOut = function() {
        this.gotoAndStop(this.frameHold);
    };
    controller_mc["but"+i].onRelease = function() {
        butRelease(this);
    };
}
function butRelease(obj) {
    this = obj;
    arrayIndex = this.i-1;
    for (var mc in this._parent) {
        var thisHold = this;
        if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
            this._parent[mc].gotoAndStop("down");
        } else {
            this._parent[mc].gotoAndStop("up");
        }
    }
    this.frameHold = this._currentframe;
}
//timeline forward and backward buttons
controller_mc.goForward.onRelease = function() {
    if (arrayIndex<7) {
        butRelease(this._parent["but"+(arrayIndex+2)]);
    }
};
controller_mc.goBack.onRelease = function() {
    if (arrayIndex>0) {
        butRelease(this._parent["but"+(arrayIndex)]);
    }
};
//external links
controller_mc.but1.onRelease = function() {
    loadMovie("chapterTest.swf", "_root.loader");
};
timeline1.link01.onRelease = function() {
    loadMovie("linkTest.swf", "_root.loader");
};
Here is a link to my file
<http://www.dougbarba.com/ftp/TimelineTest.zip>

I'll appreciate any help you are able to offer and am happy to answer questions if you need me to be more clear. Thanks
Reply With Quote

  #2 (permalink)  
Old Mar 5th, 2007, 18:05
Reputable Member
Join Date: Jul 2006
Location: exeter
Age: 20
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Loading external movies

I will have a look for you tonight when i get home!
Rusty
Reply With Quote
  #3 (permalink)  
Old Mar 6th, 2007, 13:03
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Loading external movies

This is working for me

Code: Select all
    this.frameHold = this._currentframe;
        switch (obj._name) {
    case "but1" :
        loadMovie("chapterTest.swf", "_root.loader");
        break;
    case "but2" :
        loadMovie("chapterTest.swf", "_root.loader");
        break;
    }
}
Reply With Quote
  #4 (permalink)  
Old Mar 7th, 2007, 19:34
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Loading external movies

Great, looks like Rusty is still at work...lol
Reply With Quote
  #5 (permalink)  
Old Mar 7th, 2007, 19:43
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Loading external movies

HaHa...sometimes we just never get to leave.

Here's my latest script. Of course I'll switch out all the chapterTests later on.

Code: Select all
function butRelease(obj) {
    this = obj;
    arrayIndex = this.i-1;
    for (var mc in this._parent) {
        var thisHold = this;
        if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
            this._parent[mc].gotoAndStop("down");
        } else {
            this._parent[mc].gotoAndStop("up");
        }
    }
    this.frameHold = this._currentframe;
    var mov;
    switch (obj._name) {
    case "but1" :
        mov = "chapterTest.swf";
        break;
    case "but2" :
        mov = "chapterTest.swf";
        break;
    case "but3" :
        mov = "chapterTest.swf";
        break;
    case "but4" :
        mov = "chapterTest.swf";
        break;
    case "but5" :
        mov = "chapterTest.swf";
        break;
    case "but6" :
        mov = "chapterTest.swf";
        break;
    case "but7" :
        mov = "chapterTest.swf";
        break;
    case "but8" :
        mov = "chapterTest.swf";
        break;
    }
    loadMovie(mov, "_root.loader");
}
Reply With Quote
Reply

Tags
array, external, index, loading, movie, swf, variable

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
loading external swf crazytyler34 Flash & Multimedia Forum 3 Nov 15th, 2007 21:38
loading external swf worldheadja Flash & Multimedia Forum 3 Feb 7th, 2007 19:06
design & code problem - movie index strategy and loading movies betso Web Page Design 2 Sep 11th, 2006 20:35
loading external swf razor Flash & Multimedia Forum 1 Nov 30th, 2005 15:40
Problem with latency when loading external movies ST Flash & Multimedia Forum 10 Aug 4th, 2005 11:19


All times are GMT. The time now is 01:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43