Random SWFs

Hello

I have a Web site in which a random SWF is loaded each time that the Home Page is refreshed.

I searched online and have put in place a file called 'CJRandom.swf', which consists of the following:

Sets the number of Flash movies in the random sequence
IMPORTANT: The value this number how many Flash movies you have
var myMovieSequence = 30;

Creates the random number:
var myRandomNumber = Math.floor (Math.random () * myMovieSequence) + 1;

Creates the full name of the Flash movie as: 1. swf
var myMovieName = "CJFlash" + myRandomNumber + ".swf";

Load the random Flash movie:
loadMovieNum (myMovieName, 0);

There are altogether 30 sovereign wealth funds (i.e., CJFlash1.swf, CJFlash2.swf...) CJFlash29.swf, CJFlash30.swf).

When I run CJRandom or as a SWF in Flash or on the desktop, it works perfectly.  However, I dropped the code in Dreamweaver in its own div (RandomFlash).  The SWF file will not work in Dreamweaver or if I download it on the server - all I get is a space where the SWF file should be.

All files are in the same folder, i.e. Images/FlashMovies.

I don't understand why it will not work in HTML and am tearing my hair out trying to get this working on the Web site.

I'd appreciate any help.

When you place a swf in an html page, the html page becomes its base of reference for anything that it loads, if your files SWF is all in another folder as the html file, then you need to adjust the target inside the CJRandom.swf be as if she lives in the same directory as the html file.

If you use... images/FlashMovies/CJRandom.swf

to load the CJRandom.swf fle in the web page, then you need the file CJRandom.swf to also use the images/FlashMovies/for target sovereign wealth funds, which it loads.

Tags: Adobe Animate

Similar Questions

  • How to load and replace random swf in the same charger on stage?

    Hi... it's very simple, but for some reason any escapes me: using AS3 how a swf file can load another swf to replace itself in the charger still on the stage, while at the same time calling a function of randomization in the first frame of the main timeline, to randomize the next swf?

    At the end of each swf (called "koan_ # .swf"), it is the following old AS2 code... it has been used to choose randomly, and then play a SWF of koan table:

    _root.index ++

    If (_root.index > _root.koan.length - 1) {}

    _root.index = 0;

    _root. KOAN.shuffle ();

    }

    _root.koan_loader_mc.loadMovie (_root. KOAN [_root.index]);

    This code on the first frame of the main timeline loads a koan random swf file correctly, but after that the koan plays I'd like to load a new swf random koan.

    function shuffle(a:Array):Array {}

    var len:Number is. Length-1;

    for (var ivar:Number = len; ivar > = 0; ivar-) {}

    var p:Number = Math.floor (Math.random () *(ivar+1));

    var t = a [ivar];

    a [ivar] = a [p];

    a [p] = t;

    }

    return a;

    };

    var: index: uint = 0;

    var koan_loader:Loader = new Loader();

    koan var: Array = ['swfs/koans/koan_1.swf","swfs/koans/koan_2.swf', 'swfs/koans/koan_3.swf', 'swfs/koans/koan_4.swf', 'swfs/koans/koan_5.swf', 'swfs/koans/koan_6.swf', 'swfs/koans/koan_7.swf', 'swfs/koans/koan_8.swf', 'swfs/koans/koan_9.swf', 'swfs/koans/koan_10.swf', 'swfs/koans/koan_11.swf', 'swfs/koans/koan_12.swf'];

    KOAN = shuffle (koan);

    koan_loader. Load (new URLRequest (koan [index]));

    MovieClip (this).koan_loader_mc.addChild (koan_loader);

    Thank you very much.  I tried several variations of updated AS2 code but am at my wits end.

    -Very well, bloody forums join the file for some reason, so here is the code:

    Copy and paste this code into a text file and save it as InterfaceEvent.as

    package {}

    import flash.events.Event;

    SerializableAttribute public class InterfaceEvent extends Event {}

    public static const = "koanFinished" KOAN_FINISHED:String

    public void InterfaceEvent (type: String, bubbles: Boolean = false, cancelable: Boolean = false, int index = - 1, item: Object = null) {}

    Super (type, bubbles, cancelable);

    This.index = index;

    This.Item = item;

    }

    public var int index = - 1;

    public var point: Object = null;

    override public function clone (): Event {}

    return new InterfaceEvent (this.type, this.bubbles, this.cancelable, this.index, this.item);

    }

    }

    }

  • loading random swf but not even

    someone here helped with the code for loading random SWFs in a clip... However, I need to make sure that it does not load who plays already, he is pursuing a new one to each one time...

    You can use the code below:

  • Loading random swf Array & Navigation

    I don't think that I am also familiar with the tables I need to be for the realization of the following project - I've read about 60 posts and no one seems to do exactly what I am. Here's what I do:

    Since a main swf (home.swf), I need to load 7 consecutive rulers in a random order, (movie01.swf, movie02.swf, etc.) to a table, in level 1. I need all seven to play without repeating, then repeat in the same order in a loop.

    But I ALSO need the user to be able to navigate in the SWF files using the next or previous buttons (or by individually selecting 1-7, but who can ask far too much of my limited knowledge).

    Here is the code I use to generate a randomly ordered table:

    file var names: Array = new Array ("movie01.swf", "movie02.swf", "movie03.swf");
    Shuffle = function (targetArray) {}
    for (i = 0; i < targetArray.length; i ++) {}
    var tmp = targetArray [i];
    var randomNum = random (targetArray.length);
    targetArray [i] = targetArray [randomNum];
    targetArray [randomNum] = tmp;
    }
    };
    Shuffle (file names)
    trace (file names)

    I guess that I can load SWFs of filenames [0]. I'm out of my depth, so the rest is a mystery to me. ANY help on this would be greatly appreciated.

    The random move looks like it works very well.

    If these films are meant to load such as a reading before the next load ends, you will need to create a trigger mechanism to happen... or add code for movies you load to tell the main movie to load the other, or to have the main movie, keep track of the _currentframe versus _totalframes if loaded movies are purely timeline animations and trigger the next load when these two values are equal.

    When it comes to loading tthings, you have a few choices... use loadMovie() or using MovieClipLoader.loadClip ()... this one is better and more usefull if you need follow the loading process.

    While should do is take a small bite and see what it takes to load a single film.  Then figure out how to develop in a function that takes in an array element to load.  See what you can do and if you have a problem, view the code that does not work and someone'll things iron likely help.

  • Loading random swf/f4v

    Hey I have this problem - with the help of Kglad in a previous post, more look on another post, I have the below action script.

    What I really need it to do, is to load a movie on my table, and when he replay the film must be the same movie in which has been loaded at random... So far, I have this code:

    var movies: Array = ["film/film1.f4v', ' film/film2.f4v']

    function shuffle(a:Array) {}

    for (var = ivar. Length-1; Ivar > = 0; Ivar-) {}

    var p = Math.floor (Math.random ()) (ivar + 1);

    var t = a [ivar];

    a [ivar] = a [p];

    a [p] = t;

    }

    };

    var timedelay:Number = 10;  replay-second delay

    var video;

    var nc:NetConnection;

    var ns:NetStream;

    NC = new NetConnection();

    NC. Connect (null);

    NS = new NetStream (nc);

    NS.client = this;

    ns.addEventListener (NetStatusEvent.NET_STATUS, netStatusf);

    function netStatusf(e:NetStatusEvent) {}

    If (e.info.code == "NetStream.Play.Stop" & & Math.abs(durationNum-ns.time) <. 1) {}

    setTimeout(replayF,timedelay*1000);

    }

    }

    function replayF() {}

    NS. Play (Shuffle (movies));

    }

    var durationNum:Number;

    function onMetaData(iObj:Object):void {}

    durationNum = iObj.duration;

    }

    video = new Video (287,263);

    Video.x = 231.1.

    Video.y = 140,5;

    addChild (video);

    video.attachNetStream (ns);

    NS. Play (Shuffle (movies));

    but does not seem to work, it comes with this error:

    TypeError: Error #1006: value is not a function.

    CV / shuffle)

    CV / frame3)

    at flash.display::MovieClip/gotoAndStop()

    CV / index)

    I hope someone can help...

    Oops.  my error:

    use:

    var moviesA:Array = ["film/film1.f4v'," film/film2.f4v"];

    film of the var: String = moviesA [Math.floor (Math.random () * moviesA.length)];

    var timedelay:Number = 10;  replay-second delay

    var video;

    var nc:NetConnection;

    var ns:NetStream;

    NC = new NetConnection();

    NC. Connect (null);

    NS = new NetStream (nc);

    NS.client = this;

    ns.addEventListener (NetStatusEvent.NET_STATUS, netStatusf);

    function netStatusf(e:NetStatusEvent) {}

    If (e.info.code == "NetStream.Play.Stop" & Math.abs(durationNum-ns.time))<.1)>

    setTimeout(replayF,timedelay*1000);

    }

    }

    function replayF() {}

    NS. Play (Movie);

    }

    var durationNum:Number;

    function onMetaData(iObj:Object):void {}

    durationNum = iObj.duration;

    }

    video = new Video (287,263);

    Video.x = 231.1.

    Video.y = 140,5;

    addChild (video);

    video.attachNetStream (ns);

    NS. Play (Movie);

    p.s. If you do not want to randomize an array and loop through it without repetitions, the shuffle function should be used once.  then browse your items of paintings "mixed" from index 0 to the last element.

  • is this possible?  generic - locate children swf

    I have several questions about actionscript and everything and no matter what will help me a lot. They are here:

    JavaScript (for questions 1-3)
    (1) is there a way to browse objects in a swf file? For example, if the swf file has children SWFs or a control that I want to target, I want to be able to browse the objects and find this object. I want to be able to find the children SWFs and access the values in children SWFs, and I need it to be generic so that it works with any swf there (with good course a requirement of the version).
    (2) is it possible that I can get information about an object, such as its name, current rect. Also if it is as a jpg or a swf file, can I get the URL TO which it points toward?
    (3) is there a generic way to pass the ActionScript in a swf file and tell him to evaluate it (something like the eval() call in javascript)? When I say generic, I mean for each swf file single there (of course with a limit of version if necessary).

    I have 1. SWF file that incorporates another 2 swf file. (for questions 4 and 5)
    4) from the actionscript in 1.swf, can I browse 2.swf objects? (this is essentially the question #1 from another angle)
    (5) the actionscript in 1.swf, can I get information about the objects in 2.swf? (mainly questions #2 from another angle)

    (6) If you do not know or if it is not possible to do things in 1-5, you know another way to do it, where the only requirement is that the input file is a random SWF which can make a flash developer?

    Even if you don't know the answer for you, but you have a guess who will always help. Thanks for reading this post.

    No, javascript cannot access a swf file unless the swf calls the javascript that would not meet your needs.

    You can create a swf file that contains:

  • Random when export as SWF behavior

    Hello. I use 7 Captivate, creative cloud. I feel a strange behaviour when I publish some files as SWFs. The export of html5 is OK. Sometimes some random objects are missing from some slides and some objects are displayed in wrong blades (as the boxes of slides are displayed in the other question slides). I restarted my computer and I deleted the folder Preferences without any improvement. You have some tips? Thank you!

    I was advised by one of the guys support Adobe to do like this and it worked:

    1. Go to Edit /Preferences.
    2. Select publication settings.
    3. All check outsource them resources.
    4. Then go to the SWF size & quality make it high.
    5. Then go to the video demo, video quality make as a 32 bit to 16 bit.
    6. Save the project.
    7. Your project must be saved to a Local drive and it should be published on the local c drive.
    8. Then go to publish.
    9. Change the version of Flash player 11.
    10. Then check force republish all slides option.
    11. Then publish it.
    12. And check.

    There are a lot of parameters to change and I'm not the one who fixed the issue.

    Thank you!

  • How can I publish a module with random questions (and question pool) in a single swf file?

    Hiya,

    What I need is questions randomly in a learning module all exported from captivate 4 in a single swf file, what I get is the swf file and a SWF of pool, is it possible to integrate the pool in the same module/file?

    There will be a place somewhere on the LMS where the SWF file is stored.  But the question pool to get SWFs in the same location would be more trouble that it's worth.

    Some providers of LMS simply not allowing for the fact that training may require more than one file to run it.  They have designed their systems with PowerPoint and PDF or MS Word in mind, all cases where one file is all you need.  These MOVIES are more like content management systems than modern learning management systems.

    If your LMS insists that it cannot operate in this way, then you may need to forget the question pools.

    But I think that you will have even greater problems.  You will wait get marking and follow-up of the results of this LMS for this internship?

    You be obviously NOT use SCORM as publishing option because SCORM still requires JavaScript code to implement the API that allows communication between the LMS and the module course.  Using rather AICC?  Output of Captivate, same AICC requires Javascript, so you need more than the SWF file.

  • Random AS3 swf loader repeating previous swf load

    I have about 10 images that will be load into my home page by using the code below. the problem I get is only occasionally as the same image will load twice in a row. is these existing some code I can insert into my code so that the images won't load twice now?

    var movieArray:Array is ["Simage/Simage0', ' Simage/Simage1', ' Simage/Simage2'];.

    var loader: Loader = new Loader(); var int index = movieArray.length * Math.Random ();

    var url: String = movieArray [index] + ".swf";  trace ("Attempt to load", url);  Loader.Load (new URLRequest (url));  loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loaderComplete);

    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, loaderIOError);

    addChild (loader);

    function loaderComplete(e:Event):void {}

    trace ("correctly", url);

    }

    function loaderIOError(e:IOErrorEvent):void {}

    trace ("Failed to load", url);

    }

    If you don't plan a loop, you can simply remove it from the table, but only after obtaining the required information from him...

    var int index = movieArray.length * Math.Random ();

    var url: String = movieArray [index] + ".swf";

    movieArray.splice (index 1); This will remove this element of the array.

  • How to start a list of SWFs randomly?


    I am looking for a way to randomly launch an ordered list of sovereign funds.

    Well, that's not all...

    I have my main SWF calling external SWF. I have 2 groups of external SWF

    My main SWF Actionscript, I want to chance to play a SWF in Group A and continue cycling through Group A (in order) until it's over.

    So I want to randomly start playback a SWF Group B and continue cycling through the list (in order) until Group B is cycled through.

    Then repeat group has (random startup, while remaining in the order), etc.

    Does make sense? I know it's a challenge-

    My current ActionScript works for Group A chance, select and read in order, I need to stop when it gets to the

    random starting point again (so it does not repeat) and start Group B (which is not here yet)

    var logos:Array = new Array();

    logos[0] = "logo1.swf";
    logos[1] = "logo2.swf";
    logos[2] = "logo3.swf";
    logos[3] = "logo4.swf";
    logos[4] = "logo5.swf";
    logos[5] = "logo6.swf";


    var totallogos = logos.length;
    var randlogo = Math.round(Math.random()*(totallogos-1));

    var framenum = 1;

    this.onEnterFrame = function() {
       
    //  trace(framenum);

        if (framenum == 1) {
           
            if (randlogo < (totallogos-1)) {
                randlogo += 1;
            } else {
                randlogo = 0;
            }

        trace("Number: " + randlogo);
        trace("Load Movie: " + logos[randlogo]);
        trace("---------------------------------");
       
        this.createEmptyMovieClip("holder_mc", 1);
        holder_mc.loadMovie(logos[randlogo], 1);
       

    //    placelogo(randlogo);
           
        }
           
        if (framenum < 30 ) {
            framenum += 1;
        } else {
            holder_mc.unloadMovie();
            framenum = 1;
        }

    }

    Try:

    var groupA: Array = [Group A sovereign funds];
    var groupB:Array = [Group B sovereign wealth funds];

    this.createEmptyMovieClip("holder_mc",1);

    var playIndex:Number = Math.floor (Math.random () * groupA .length);
    var playedNum:Number = 0;
    var playingA:Boolean = true;

    holder_mc.loadMovie (groupA [playIndex]);
    this.onEnterFrame = function() {}
    If (Dun & holder_mc._totalframes > 1 & holder_mc._currentframe > = holder_mc._totalframes) {}
    playedNum ++;
    If (playedNum
    playAF();
    } else {}
    DUN = false;
    playIndex = Math.floor (Math.random () * groupB.length);
    playedNum = 0;
    holder_mc.loadMovie (groupB [playIndex]);
    }
    } else {}
    If (holder_mc._totalframes > 1 & holder_mc._currentframe > = holder_mc._totalframes) {}
    playedNum ++;
    If (playedNum
    playBF();
    } else {}

    delete this.onEnterFrame;
    all SWFs have played
    }
    }
    }
    };

    function playAF() {}
    playIndex = (playIndex+1)%groupA.length;
    holder_mc.loadMovie (groupA [playIndex]);
    }

    function playBF() {}
    playIndex = (playIndex+1)%groupB.length;
    holder_mc.loadMovie (groupB [playIndex]);
    }

  • AS3 array used to load and read SWFs randomly?

    Hi, I am using a suitable picture of AS2 script to load the SWF randomly called "koan_1.swf" or "koan_2.swf" etc. in a "koan_loader_mc" on the stage.  Each ' koan_ # .swf "a code in its last image both advance table of"shuffle"in the first frame of the stage action script and load the next koan swf.  The code below works - almost-, but...?

    Section on the main stage:

    create the function that is called at the end of koan_ # .swfs

    function shuffle(a:Array) {}

    for (var = ivar. Length-1; Ivar > = 0; Ivar-) {}

    var p = Math.floor (Math.random ()) (ivar + 1);

    var t = a [ivar];

    a [ivar] = a [p];

    a [p] = t;

    }

    };

    charge of the koans in koan_loader_mc

    var: index: uint = 0;

    var koan_loader:Loader = new Loader();

    koan var: Array = ['swfs/koans/koan_1.swf","swfs/koans/koan_2.swf', 'swfs/koans/koan_3.swf', 'swfs/koans/koan_4.swf', 'swfs/koans/koan_5.swf', 'swfs/koans/koan_6.swf', 'swfs/koans/koan_7.swf', 'swfs/koans/koan_8.swf', 'swfs/koans/koan_9.swf', 'swfs/koans/koan_10.swf', 'swfs/koans/koan_11.swf', 'swfs/koans/koan_12.swf'];

    KOAN.shuffle ();

    koan_loader. Load (new URLRequest (koan [index]));

    MovieClip (this).koan_loader_mc.addChild (koan_loader);

    MovieClip (this) .stop ();

    The code is on the last frame of the koan loaded SWFS:

    MovieClip (stage) .index ++

    {If (MovieClip (stage) .index > {MovieClip (internship).koan.length - 1})}

    MovieClip (stage) .index = 0;

    MovieClip (stage).koan.shuffle ();

    }

    MovieClip (stage).koan_loader.load (new URLRequest (koan [MovieClip (internship) .index]));

    MovieClip (stage).koan_loader_mc.addChild (koan_loader);

    Thank you-everything - advice and suggestions... at the end of my rope...

    Yes, 'shuffle' function is to have an error: Please see update below code:

    function shuffle(a:Array)
    {

    for (var = ivar. Length-1; Ivar > = 0; Ivar-)
    {
    var p = Math.floor (Math.random ()) * (ivar + 1);

    This line cannot be written as var percent = Math.floor (Math.random ()) (ivar + 1); [* Star is important]
    var t = a [ivar];
    a [ivar] = a [p];
    a [p] = t;
    }
    };

  • Randomizing JPG and SWF?

    I use one, which seems to me, a simple script to select pre-determined images and display them on the page randomly. When someone navigates to the page or refreshes the page, I want to choose randomly from the list to display the image. Some of the images are SWF files.

    Be little newer to this business of coding, but with the great help of the IT staff, we do not seem to recognize SWF files to display.

    Please, if anyone knows how or where to look so I could learn how do it, could be a plug in anything! This exceeded discouraging.

    I am posting this so everyone knows it's possible. I spent a lot of time to figure out and my computer came up with a way to work around thing.

    What to follow is the script to make SWF files and swap JPG randomly on a page.

    Here are a couple of pointers;

    (A) use single quotes instead of double quotes "to include tags in the definitions of xoxo [x].

    (B) the definition of integer xoxo [x] of single quote to single quotation mark MUST be on a single line.

    (C) and used javascript code where you place the random image must of course also be updated to not have the tag in there (because it's now part of the table xoxo)

    Any questions, I can try to answer best told me.
    Thanks for the help guys, I hope this helps someone too!

    Contact:
    [email protected]

    The insert point put this piece of script.

  • SWF (made through Flash Pro CS5.5) and published in the playbook (via the flash AS3 generator project) is incredibly, incredibly slow.

    Hello. As said, it's horribly slow.

    It is a simple slap a mole, with 9 total game hit areas, with animation by MC popping up randomly in the regions and a timer to countdown a minute.

    The timer is operating at about a quarter of the speed should be. A second takes about four. My animations are also stuttery. My FPS in my flash game is set to 120. (If there is a ton of objects on stage, I get the big slowdowns, that I expected, but the full game seems to work at a slower than expected level)

    I tried GPU/CPU rendering (both on the swf and FB project), but also to tweak the game to speed it up.

    I was wondering if anyone has a solution as to why these games so run slow. I do not have the resolution of the game the value 600 x 1024 (portrait), is this correct? Or should I make a game of 300 x 640 and fullscreening it.

    I tried HTML5 as well, integrating flash. It works just as slow (unless miss me an option of rendering in config.xml or something)

    It turns out I was right. I was overloading the first image with kidnapping event handler commands

    These event handlers had been removed in other frames before moving the playhead to frame 1, so the code on frame 1 was redundant. hope that helps

  • Software Simulation lines random question on slides

    I work in Captivate 9 and I have a few slides in my project which are software simulation slides.  I used the slide button to start the software simulation.  When I saw my software simulation in Captivate in HTML5, it looks great.  When I post for others to look at the ReviewMyElearning, there are random lines that go through the slides.  I tried recording on different browsers and even on another computer, and nothing has worked.  These lines went away after I re-recorded, but are back once again after I cleared my cache for an unrelated question.   These lines randomly through the slides of simulation are only on the last few slides, and are in the same place on each of the relevant slides.

    Help please!

    You can check the preferences of project size and quality settings? Don't forget to uncheck the option "Advanced project Compression" and the "compress SWF file. Then publish again and check if the problem is still there.

  • How to connect with Adobe Media Server random remote Shared Object

    Hello, I have my application on the web developed in Flash Professional CC and exported to Flash Player 13.

    In my web app, I have 2 classes: connection (which creates the connection with my Adobe Media Server) and GlobalObject (that creates the remote shared object).

    This is the code I have:

    Connection class

    import flash.events.AsyncErrorEvent;

    import flash.events.Event;

    import flash.events.IOErrorEvent;

    import flash.events.SecurityErrorEvent;

    import flash.events.SyncEvent;

    import flash.events.NetStatusEvent;

    import flash.net.NetConnection;

    import flash.net.ObjectEncoding;

    import flash.net.SharedObject;

    var nc:NetConnection = new NetConnection();

    nc.objectEncoding = ObjectEncoding.AMF3;

    NC.client = this;

    nc.proxyType = "best";

    nc.addEventListener (NetStatusEvent.NET_STATUS, netSAServerRTMPStatus);

    nc.addEventListener (IOErrorEvent.IO_ERROR, onIOError);

    nc.addEventListener (AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

    nc.addEventListener (SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

    NC. Connect ("rtmp://myAMS_URL:1935 / myApp", "myRandomChannel");

    var _ro:GlobalObject;

    function onIOError(e:IOErrorEvent):void

    {

    trace ("onIOError");

    }

    function asyncErrorHandler(e:AsyncErrorEvent):void

    {

    trace ("asyncErrorHandler =" + e.error);

    }

    function onSecurityError(e:SecurityError):void

    {

    trace ("onSecurityError =" + e.error);

    }

    function netSAServerRTMPStatus(event:NetStatusEvent):void

    {

    Switch (info.code)

    {

    case "NetConnection.Connect.Success":

    trace ("Connected");

    ConnectToSharedObject();

    by default:

    trace (e.info.code);

    break;

    }

    }

    function ConnectToSharedObject (): void

    {

    _ro = new GlobalObject();

    var randomRO:Number = Math.Random ();

    _ro. Connect (randomRO, nc, false);

    trace (_ro. Connected);

    If (_ro. Connected is true)

    {

    _ro.addEventListener ("onNewMsg", onNewMsg);

    _ro.sendNewMsg ("hello");

    }

    }

    function onNewMsg(e:Event):void

    {

    trace (e.Target.chatMsg);

    }

    GlobalObject class

    import flash.events.AsyncErrorEvent;

    import flash.events.Event;

    import flash.events.EventDispatcher;

    import flash.events.SyncEvent;

    import flash.net.NetConnection;

    import flash.net.ObjectEncoding;

    import flash.net.SharedObject;

    var so: SharedObject;

    var connected: Boolean;

    var _msg:String;

    function GlobalObject()

    {

    Super();

    }

    function connect(p_soName:String,_p_nc:NetConnection,_p_persistant:Boolean):void

    {

    create StoredObject

    So = SharedObject.getRemote (p_soName, p_nc.uri, p_persistant);

    so.client = this;

    Configure the onSync events

    so.addEventListener (SyncEvent.SYNC, onSync);

    connect to the SO

    so. Connect (p_nc);

    connected = true

    }

    function logout (): void

    {

    so. Close();

    }

    function onSync(evt:SyncEvent):void

    {

    trace ("onSync");

    }

    public void sendNewMsg(msg:String):void

    {

    so. Send ("mewMsg", msg);

    }

    function mewMsg(msg:String):void

    {

    _msg = msg;

    dispatchEvent (new Event ("onNewMsg", _msg));

    }

    The problem is that I have ever received the 'onSync' event, then, so I never got the messages. What I am doing wrong? I have to add or change?

    I have no code (C:\ProgramFiles\Adobe\AdobeMediaServer5\applications\myApp) server-side. All this code is compiled and exported as a SWF file, and this is the file that the user charge when go to my Web page.

    Hope someon could help me.

    Best regards

    Manel

    Hello

    The problem is solved! The point is that the AMS folder that I created were defined as 'direct' default app. Once I changed that, it work corretly.

    Best regards

Maybe you are looking for