lone_wild_wolf
June 5th, 2006, 07:42 AM
Hi all,
You see I have a game (still a WIP).
I need help with methods to load different maps into an mc using external swf’s.
I tried using the load movie function. It worked fine until I realized that I also needed to use gotoAndStop () function. Then it became a thumbs down :diss:
Any suggestions appreciated.
Thanking you,
Lone_wild_wolf
BTW. It’s art-based
Templarian
June 7th, 2006, 09:17 PM
Wait that makes no sense... after it needed gotoAndStop it didnt work?
_root.createEmptyMovieClip("container",1);
_root.container.loadMovie("awsome.swf")
_root.container.mvcinswf.gotoAndPlay();
lone_wild_wolf
June 7th, 2006, 10:42 PM
hey Templarian,
Where did you get the mvcinswf from?
Thanks
lone_wild_wolf
June 10th, 2006, 10:04 AM
uh Templarian?
nathan99
June 10th, 2006, 10:28 AM
prolly stands for like movieclipinswf
stoodder
June 10th, 2006, 02:28 PM
uh Templarian?
im having the same problem witha gma eim making becaus ei dont want to have to carry so many maps and characters around in one flahs movie instead i would liek to load them externally. anyways i think you could probobly use LocalConnection(). give it a check in the flash help file, im just about to test it outmyself. for what i know it will connect two movies togethor even if they are not inside of one another and your able to send data to another flahsmovie, (it calls upon a funciton in the other flash movie.
Flash 8 Documentation http://livedocs.macromedia.com/flash/8/main/images/fp_spacer.gif
ActionScript 2.0 Language Reference (http://livedocs.macromedia.com/flash/8/main/Part4_ASLR2.html) > ActionScript classes (http://livedocs.macromedia.com/flash/8/main/00001893.html) > LocalConnection http://livedocs.macromedia.com/flash/8/main/images/shim.gifhttp://livedocs.macromedia.com/flash/8/main/images/pixel.gifhttp://livedocs.macromedia.com/flash/8/main/images/shim.gif
LocalConnection
Object
|
+-LocalConnection
public dynamic class LocalConnection
extends Object
The LocalConnection class lets you develop SWF files that can send instructions to each other without the use of fscommand() or JavaScript. LocalConnection objects can communicate only among SWF files that are running on the same client computer, but they can be running in different applications--for example, a SWF file running in a browser and a SWF file running in a projector. You can use LocalConnection objects to send and receive data within a single SWF file, but this is not a standard implementation; all the examples in this section illustrate communication between different SWF files.
The primary methods used to send and receive data are LocalConnection.send() and LocalConnection.connect(). At its most basic, your code will implement the following commands; notice that both the LocalConnection.send() and LocalConnection.connect() commands specify the same connection name, lc_name:
// Code in the receiving SWF file
this.createTextField("result_txt", 1, 10, 10, 100, 22);
result_txt.border = true;
var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.methodToExecute = function(param1:Number, param2:Number) {
result_txt.text = param1+param2;
};
receiving_lc.connect("lc_name");
// Code in the sending SWF file
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "methodToExecute", 5, 7);
The simplest way to use a LocalConnection object is to allow communication only between LocalConnection objects located in the same domain because you won't have security issues. However, if you need to allow communication between domains, you have several ways to implement security measures. For more information, see the discussion of the connectionName parameter in LocalConnection.send() and the LocalConnection.allowDomain and LocalConnection.domain() entries.
Availability: ActionScript 1.0; Flash Player 6
Property summary
Properties inherited from class Object constructor (http://livedocs.macromedia.com/flash/8/main/00002580.html), __proto__ (http://livedocs.macromedia.com/flash/8/main/00002585.html), prototype (http://livedocs.macromedia.com/flash/8/main/00002586.html), __resolve (http://livedocs.macromedia.com/flash/8/main/00002588.html)
Event summary
Event
Description
allowDomain (http://livedocs.macromedia.com/flash/8/main/00002339.html) = function([sendingDomain:String]) {}
Invoked whenever receiving_lc receives a request to invoke a method from a sending LocalConnection object.
allowInsecureDomain (http://livedocs.macromedia.com/flash/8/main/00002340.html) = function([sendingDomain:String]) {}
Invoked whenever receiving_lc, which is in a SWF file hosted at a domain using a secure protocol (HTTPS), receives a request to invoke a method from a sending LocalConnection object that is in a SWF file hosted at a nonsecure protocol.
onStatus (http://livedocs.macromedia.com/flash/8/main/00002345.html) = function(infoObject:Object) {}
Invoked after a sending LocalConnection object tries to send a command to a receiving LocalConnection object.
Constructor summary
Signature
Description
LocalConnection (http://livedocs.macromedia.com/flash/8/main/00002344.html)()
Creates a LocalConnection object.
Method summary
Modifiers
Signature
Description
close (http://livedocs.macromedia.com/flash/8/main/00002341.html)() : Void
Closes (disconnects) a LocalConnection object.
connect (http://livedocs.macromedia.com/flash/8/main/00002342.html)(connectionName:String) : Boolean
Prepares a LocalConnection object to receive commands from a LocalConnection.send() command (called the sending LocalConnection object).
domain (http://livedocs.macromedia.com/flash/8/main/00002343.html)() : String
Returns a string representing the domain of the location of the current SWF file.
send (http://livedocs.macromedia.com/flash/8/main/00002346.html)(connectionName:String, methodName:String, [args:Object]) : Boolean
Invokes the method named method on a connection opened with the LocalConnection.connect(connectionName) command (the receiving LocalConnection object).
Methods inherited from class Object addProperty (http://livedocs.macromedia.com/flash/8/main/00002579.html), hasOwnProperty (http://livedocs.macromedia.com/flash/8/main/00002581.html), isPropertyEnumerable (http://livedocs.macromedia.com/flash/8/main/00002582.html), isPrototypeOf (http://livedocs.macromedia.com/flash/8/main/00002583.html), registerClass (http://livedocs.macromedia.com/flash/8/main/00002587.html), toString (http://livedocs.macromedia.com/flash/8/main/00002589.html), unwatch (http://livedocs.macromedia.com/flash/8/main/00002590.html), valueOf (http://livedocs.macromedia.com/flash/8/main/00002591.html), watch (http://livedocs.macromedia.com/flash/8/main/00002592.html)
hopefulyl that helps
though im interested in learning what templarian was talking about too
best of luck
stoodder
June 10th, 2006, 04:10 PM
prolly stands for like movieclipinswfyep he was right, all you have to do is name a movieclip inside of the loaded swf file and you will be able to call it from the original swf
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.