A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [F8] external swf loaded in

  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    29

    [F8] external swf loaded in

    i have a login swf that works on it's iwn. it has the actionscript below:

    keyframe
    Code:
    stop();
    userinput.restrict = "a-zA-Z0-9";
    Selection.setFocus(userinput);
    passinput.restrict = "a-zA-Z0-9";
    status = "Enter your information and submit";
    this.onEnterFrame = function() {
    	if (checklog == 2) {
    		delete this.onEnterFrame;
    		gotoAndPlay(27);
    	}
    	if (checklog == 1) {
    		delete this.onEnterFrame;
    		gotoAndPlay(15);
    	}
    };
    button
    Code:
    on (release, keyPress "<Enter>") {
    	status = "Begin Login Process - Wait...";
    	loadVariablesNum("newlogin.php", 0, "POST");
    }
    when login.swf is loaded into another swf the login doesn't work but it works when it's on it's own. anyone got any idea how to fix this?

  2. #2
    Senior Member
    Join Date
    Sep 2003
    Posts
    107
    sounds similar to my problem posted here. It seems like loding in .swf's doesn't like to load in the code with it. I'm tryin all kinds of places to find out how to load in .swf's and keep the code but noone seems to want to show me the way.

    http://board.flashkit.com/board/showthread.php?t=722159

  3. #3
    Senior Member freshly's Avatar
    Join Date
    Dec 2003
    Location
    Toronto, Canada
    Posts
    439
    If I understand you guys, you need to lock the root in your external swf.

    try placing this code in the first frame of your external fla

    Code:
    this._lockroot = true;
    the reason your code isn't working is because when you load the external swf into your main movie the root becomes the main file, your code is written to work if the external file is the root, so by locking the root in the external this will not happen, hope I helped
    Last edited by freshly; 02-27-2007 at 05:29 PM.

  4. #4
    Senior Member
    Join Date
    Sep 2003
    Posts
    107
    Well, that fixed mine, thanks sooo much freshly!!!!

  5. #5
    Senior Member freshly's Avatar
    Join Date
    Dec 2003
    Location
    Toronto, Canada
    Posts
    439
    No problem!

  6. #6
    Junior Member
    Join Date
    Mar 2005
    Posts
    29
    i added that and changed the code to this:
    Code:
    stop();
    userinput.restrict = "a-zA-Z0-9";
    Selection.setFocus(userinput);
    passinput.restrict = "a-zA-Z0-9";
    status = "Enter your information and submit";
    this.onEnterFrame = function() {
    	if (checklog == 2) {
    		delete this.onEnterFrame;
    		_root.gotoAndPlay(27);
    	}
    	if (checklog == 1) {
    		delete this.onEnterFrame;
    		_root.gotoAndPlay(15);
    	}
    };
    still not working!

    anymore suggestions?

  7. #7
    Senior Member freshly's Avatar
    Join Date
    Dec 2003
    Location
    Toronto, Canada
    Posts
    439
    did you try adding

    this._lockroot = true;

    to the timeline in your external swf, if it still doesn't work than you know its not a root issue. Other than that I don't really know.

    You could post a source file and I could look at it.

  8. #8
    Junior Member
    Join Date
    Mar 2005
    Posts
    29
    yup, but would i have to add it to a kyframe that runs throughout the whole movie timeline?

  9. #9
    Senior Member freshly's Avatar
    Join Date
    Dec 2003
    Location
    Toronto, Canada
    Posts
    439
    ya just place it on the main timeline of your external swf on the first frame.

    Don't place it in your MC, just on the main timeline. The frame that you place the code on does not have to run along the whole timeline because flash recognizes it on runtime.

  10. #10
    Junior Member
    Join Date
    Mar 2005
    Posts
    29
    still not working, here's the .fla
    Attached Files Attached Files

  11. #11
    Senior Member freshly's Avatar
    Join Date
    Dec 2003
    Location
    Toronto, Canada
    Posts
    439
    Sorry I need both files to see exactly how they are interacting, also, what exactly isn't working?

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