Flash 8 AS2 Smiles in chat

Hello all! I have a chatbox and I want to replace "" with an emoticon  and when I enter it the image comes on the left side behind the username  instead of being before text inputed. I changed the code using "  align='right' " and now it goes on right far away on message box [HTML  ISsue maybe]. I have attached the code, it is Flash 8 AS2. I was  thinking about making the image as movieclip and then trying to replace  it like that inside the library. Can anyone help please?
users_so.msgFromSrvr = function(msg) {
    var _loc2 = new Array();
    _loc2 = msg.split("!!");
    if (_loc2[3] == "PRIVATE" && PRIVATE == 1 || _loc2[3] == "PUBLIC" && PRIVATE == 0) {
        String.prototype.replace = function(pattern, replacement) {
      return this.split(pattern).join(replacement);
        my_str = _loc2[2];
        my_str = my_str.split(':)').join("<img src='URL\smile1.jpg' width='16' height='16' align='right' />");
        var _loc3 = "<font color=\'"+_loc2[1]+"\'>"+_loc2[0]+":"+my_str+"</font>";
        trace(my_str);
        _root.txHistory.htmlText = true;
        _root.txHistory.text = _root.txHistory.text+_loc3;

Any comments on this?

Similar Messages

  • Cross domain scripting at run time using local connection flash AS2

    Hi
         I want to do live video streaming using FMS and FMLE in Flash As2. Suppose 100 users watching video online and I want to show message to  all 100 users using the Local connection.
    If I am sending message using different browser in same pc then I can get the message which was send from another swf file but I am checking from another pc then message not coming in receiver swf file.
    Please find the code below. 
    receievemovie.swf
    // Code in the receiving SWF file
    this.createTextField("result_txt", 1, 10, 10, 100, 22);
    System.security.allowDomain("*")
    System.security.allowInsecureDomain("*")
    var my_lc:LocalConnection = new LocalConnection();
    my_lc.allowDomain = function(sendingDomain:String) {
    domain_txt.text = sendingDomain;
    return true;
    my_lc.allowDomain = function(sendingDomain:String) {
    return (sendingDomain == "*");
    my_lc.allowInsecureDomain = function(sendingDomain:String) {
    return (sendingDomain == "*");
    my_lc.methodToExecute = function(param1:String) {
        result_txt.text = param1
    myResult.text=param1
    my_lc.connect("lc_name");
    sendmovie.swf
    System.security.allowDomain("*")
    System.security.allowInsecureDomain("*")
    var sending_lc:LocalConnection;
    var sending_lc:LocalConnection = new LocalConnection();
    sending_lc.allowDomain = function(sendingDomain:String) {
    return (sendingDomain == "*");
    sending_lc.allowInsecureDomain = function(sendingDomain:String) {
    return (sendingDomain == "*");
    myButton.onRelease = function(){
    sending_lc = new LocalConnection();
    sending_lc.send("lc_name", "methodToExecute", sendMsg.text);
    sendMsg.text="Message has been sent"
    If you have any other way to do it please suggest me to do that.
    Thanks & regards
    Sunil Kumar

    Hi, go to
    Flash Resources , you can
    find a java application that can serve policy files to resolve this
    problem.

  • Re-sizing, align right while keeping the menu fixed using flash AS2

    contact
    khuon
    mau
    My problem is recreating the align right effect while keeping
    the menu fixed using flash AS2 mostly for re sizing as well as
    different screen sizes.
    While i can do one or the other but both is just not
    happening.
    I have tried all sorts of weird and wonderful things but as
    yet, alas no easy/simple solution :(
    I must admit it has been a long time since i have been here
    but.. I thought if someone could have a quick look and maybe please
    give me a few pointers ??
    Anything at all would be better than what i have now ...
    Thanks for your time

    The link again is I forgot to add http to the link before, but it should have worked.
    http://www.lipowiec.org/test/index.php
    a) used Dreamweaver to create new site selected 1 column, elastic, centered, header, and footer
    b) used spry to add horizontal menu to header
    c) followed instructions from Spry Help
    http://livedocs.adobe.com/en_US/Spry/SDG/index.html?lang=en_US ->
    working with spry widgets -> working with the menu bar widget -> Customize the dimension of menu items as indicated
    To change the dimension of menu items by changing the width properties of the menu item’s li and ul tags.
    Locate the ul.MenuBarVertical li or ul.MenuBarHorizontal li rule.
    Change the width property to a desired width, or change the property to auto to remove a fixed width, and add the property and value white-space: nowrap; to the rule.
    Locate the ul.MenuBarVertical ul or ul.MenuBarHorizontal ul rule.
    Change the width property to a desired width (or change the property to auto to remove a fixed width).
    Locate the ul.MenuBarVertical ul li or ul.MenuBarHorizontal ul li rule.
    Add the following properties to the rule: float: none; and background-color: transparent;.
    Delete the width: 8.2em; property and value.
    Under IE it's broken, under the other browsers it works.
    There need to be more IE HACKS added.

  • Insert image from file in Adobe Flash AS2

    Hello!
    I am working on one project in Adobe Flash AS2 and I would like to know, is it possible to create such button in the flash movie, that when is pressed on, opens a file browser for the computer. After that, the user chooses an image to insert in the flash movie. And the image changes from the old one (apple) to the new one (flower).
    For better understanding I added pictures. I hope You understand what I mean..
    I have searched in web how to do this, but no success at all..Hoping on Your advice. Thanks!!!

    Update - I tried using the loadMovie() function and it works, but not exactly as I was imagining. To be more precise with my planned option I will give this example for better understanding :
    Lets say, that I make a Flash project for other users who have no programming skills. In this project (the swf movie) there is a place(a button "Insert image")
    to upload an image and save it to the swf file, but it can't be done through typing the image URL in the actionscript (like doing an actual coding), but simply by opening the file browser in computer within the swf file.
    I hope You understand what I mean.
    I would like to know is this option even possible in Adobe Flash AS2
    I am thankful for Your replies and advices.

  • Problem with Preloader in my Flash AS2 Game

    I have been using this tutorial to make a preloader:
    http://www.republicofcode.com/tutori.../preloader_bc/
    I have run into one problem though.
    When I simulate the download, it just shows the background color of the game while it loads, and when it finished loading, it shows the loading screen fully loaded. I have followed the tutorial exactly, except added my file names into the AS2 code.
    Here is the ActionScript in Frame 1 I have for the preloader:
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    stopAndGoto(1);
    preloaderBar._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loaderTxt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
    Any hints or answers to what i'm doing wrong?
    Thanks, MrA615.

    Your description of what you've done and the code you show does not match what the tutorial says to do and what code to use... (there is no stopAndGoTo() function in Flash).
    Right-click the second frame on the upper layer labeled Actions and select Actions. Copy and paste the code below to make our preloader functional.
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    gotoAndPlay(1);
    bar_mc._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loader_txt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";

  • How To insert Day And Time In flash AS2?

    I want to display Day and time in flash with AS2
    not only that i want to put certain event on certain date and time
    that means
    i have a movie clip with object on it ,when i run it,
    it changes its position
    BUT now i want to change movie clip position on certain date and time
    for eg;
    I have made a simple move clip of firework i want it auto play when it is
    (01.01.2012) (12:00 AM)
    Help Me.....

    user time is easiest.  the following checks if it's between 12am and 1am jan 1, 2012.
    var d:Date=new Date();
    if(d.getMonth()==0&d.getDate()==1&&d.getFullYear()==2012&&d.getHours()<1){
    // fireworks

  • Help! Convert simple Flash AS2 code to AS3

    Hi everyone,
    I'm a Flash beginner and followed a tutorial: http://www.webwasp.co.uk/tutorials/018/tutorial.php ... to learn how to make a "live paint/draw" effect. I didn't realize  that if I made something in AS2, I wouldn't be able to embed it (and  have it work) into my root AS3 file, where I've got a bunch of other  stuff going on. I've tried following tips on how to change AS2 code to  AS3, but it just doesn't work. I know it's simple code, and that some  genius out there can figure it out, but I'm at a loss. Please help!
    Here's the AS2 code:
    _root.createEmptyMovieClip("myLine", 0);
    _root.onMouseDown = function() {
       myLine.moveTo(_xmouse, _ymouse);
       ranWidth = Math.round((Math.random() * 10)+2);
       myLine.lineStyle(ranWidth, 0xff0000, 100);
       _root.onMouseMove = function() {
          myLine.lineTo(_xmouse, _ymouse);
    _root.onMouseUp = function() {
       _root.onMouseMove = noLine;
    Thanks in advance!
    Signed,
    Nicolle
    Flash Desperado

    Considering the code is on timeline:
    var myLine:Sprite = new Sprite();
    addChild(myLine);
    var g:Graphics = myLine.graphics;
    addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    function onMouseDown(e:MouseEvent):void {
         var ranWidth:Number = Math.round((Math.random() * 10) + 2);
         g.clear();
         g.lineStyle(ranWidth, 0xFF0000, 1);
         addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseMove(e:MouseEvent):void {
         g.lineTo(mouseX, mouseY);
    function onMouseUp(e:MouseEvent):void {
         removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);

  • Switching from Flash-AS2 to Flex

    Hello !!! I am new in this flex tech
    I have made a project in AS2 with Flash. and communicating with the data through XMLs
    here is that link http://sanjoghelpline.in/Application_RWSS/default.asp
    Now I have to play with large set of data with graphs, grids, different options etc on this maps. I think Flex will be best for it. it will directly connect to the database to fetch datas. I am planning to use webservice.
    So I need your suggestion and tips for this. And what serverside language I should choose.

    Good choice. Best you can do is making a new project with Flex Builder.
    Probably you can use (parts of) your existing AS2 code (be aware of the differences with AS3).
    Is there a particular reason why you want to use webservices?
    If not, you can considering calling the data-XML's directly by HTTPService for example.
    This tool will help as well:
    http://www.adobe.com/devnet/flex/tourdeflex/web/#sampleId=0;illustIndex=0;docIndex=0

  • Preloading a published captivate recording to flash AS2

    Hi,
    I have a video recording made in adobe captivate 4 and disabled the preloader on the publish preferences. The reason why I disabled this is because other people cannot see the preloader while the captivate movie is loading but the preloader displays when I view it online usign my computer (Do you have any idea on how I can fix this?). As an alternative/workaround I created a movieclip loader class and load the external captivate movie in flash. The preloader that I created works. However, the captivate movie plays at once even if the movieclip loader hasn't reached 100%. How can I prevent the captivate movie to play while the preloader isn't 100%? I also get an error on flash while simulating download in flash. The error says:
    Branching::script:;;
    deepak branching : scripteval:[object Object];
    When I get that error, that is the time that the captivate movie plays. Below is my code in flash it is in AS2.
    var linking:MovieClip = _root;
    var level2 = linking.attachMovie("captivateHolder", "captivateHolder", this.getNextHighestDepth());
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.loadClip("captivate/prequalified_contractors.swf", level2.captivateMovie);
    var preload:Object = new Object();
    loader.addListener(preload);
    preload.onLoadStart = function(target){
      trace("Started Loading");
    preload.onLoadProgress = function (target, loadedBytes, totalBytes){
      level2.captivatePreloader.text = Math.floor((loadedBytes/totalBytes)*100)+"%";
      level2.captivateMovie.rdcmndNextSlide = 0;
    preload.onLoadComplete = function(target){
      level2.captivatePreloader.text = " ";
      level2.captivateMovie.rdcmndNextSlide = 1;
    I tried to restrict the captivate movie from playing by putting rdcmndNextSlide = 0;
    My question is, how can I restrict the captivate movie from playing while the event is still on the onLoadProgress and make it play once the preloader reaches 100%.
    This is the first time that I used adobe captivate 4.
    Thank you.
    Regards,
    Harry

    You could pause the Captivate project when you start to preload it by using the Captivate system variables. Then when your file has been loaded 100% you could resume it again by using a different system variable.
    You can see a list of the various system variables here: http://www.cpguru.com/2009/04/28/system-variables-in-captivate-4-%e2%80%93-a-complete-list /
    The relevant variables for you would be:
    rdcmndPause = 1; (to pause the project)
    rdcmndResume = 1; (to resume playback)
    Naturally you need the instancename (where you load your Captivate movie into) infront of the variable name.
    myLoaderContainer.rdcmndPause = 1;
    /Michael

  • How to upload single heavy video file by flash AS2.0

    How can I upload single heavy video file by AS2.0 with php backend?
    I have video file of 200 GB but flash officially supports 100MB.
    http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/FileReference.html
    Then how this can be achieved?

    As far as I know edge is always going to create that whole set of files. that's just the way it works. You had said that your problem stemmed from the fact that you had a lot of these animations or what you called "flashcards" and you didn't want to have to upload a whole set of project files for each card.  right?? My suggestion was just a way to package all your "flashcard" animations into a single edge project so you only have to upload a single set of files for all your "flashcards" . that said, not knowing what your application is or the way the user interacts with the cards this approach might not work for you at all. But I don't think there is a single file (like a swf) solution for edge projects.
    Joel H

  • Open PDF from Flash (AS2)?

    I have a button inside my flash movie and I would like to give the user the option to download a pdf on clicking the button.
    I am using Flash CS4 and AS2.
    What options do I have if I want one of these-
    a) Open the pdf in a new browser window/tab
    b) Give user the option to save the pdf to their computer instead of it opening in the browser automatically.
    I am not smart with coding so any help with the code would be appreciated. Thanks.

    The easiest approach is to use getURL and open the pdf in another browser window...
    getURL("your.pdf", "_blank");
    For the second part you could use the FileReference class to provide downloading, but it is more complicating to configure.  The getURL approach will give the same net result since the file is downloaded and saveable via the browser window anyways.

  • SharedObject in flash AS2.0

    Dear all,
    I have a problem with SharedObject. I created SharedObject using AS2.0 it's working fine.... my question is can it possible to store the variable values in an .txt file where the flash file is saved... basically the SharedObject will store the vallues in localdrive with file extention .so or .sol...if any posibility is there help me please... not only using SharedObject if any other way to store the vaules in .txt file will be helpfull for me... so, please help me if any one know the solution...my requirement is to store the the position of the swf file and when the time it reopen, it should start from  previous position.
    Thanks in advance
    Regards
    Santhosh Kumar Mallepaddy...

    no, you can't use the sharedobject to save in any format other than the so format.
    using the filereference class you can save a local file.

  • Flash, AS2 fscommand not working

    hi,
    I have a flash application working fine in a html page. i want to add javascript interaction.
    I see that i have to use fscommand . when i compile and execute my flash application inside flash CS4 and test it directly from the generation directory (D:\dev\flash\myApp), it work find.
    If i copy my project directory in another directory (D:\dev\flash\release\myApp), it's not working.
    I don't understand why !
    I never reach the javascript code.
    Thanks for your help.

    If I understand you correctly, I think the 'shared object' might be what you need.
    The AS2 Language Reference in F8 starts off like this:
    "The SharedObject class is used to read and store limited amounts of data on a user's computer. Shared objects offer real-time data sharing between objects that are persistent on the user's computer. Local shared objects are similar to browser cookies. ....."
    hope that helps.

  • Integrating BlazeDS into a Flash AS2 application

    All,
    I'm looking for some information about the feasibility of connecting a Flash application built in AS2 to BlazeDS.
    Is this possible? Are there any tutorials/overviews to help me get started?
    Many thanks in advance for any insights or advice.

    Hi.
    If you just want to talk to a remoting destination in BlazeDS this is not too difficult. Here is a blog posting that Mete (one of the developers on the LCDS/BlazeDS team) wrote that describes how to do this using the NetConnection API.
    http://meteatamel.wordpress.com/2010/01/22/netconnection-and-remoting-in-blazedslcds/
    If you wanted to do pub/sub messaging that would probably require back porting quite a lot of the BlazeDS messaging code to AS2 which I imagine would be quite difficult.
    Hope that helps.
    -Alex

Maybe you are looking for