Flash SWF (with as3 code) integrate in Flex probelm

Hello everyone,
I'm having a problem to make my Flash SWF working in Flex. I
created an animation movieclip, made a button and wrote a script to
play this movieclip in Flash. Everything works fine but when I use
SWFLoader in Flex to integrate this SWF in my application. This
"play" button is working anymore in Flex.
Should I remove the button and script in Flash and put them
in Flex? How could I write the script in Flex to call a function to
play this SWF?
Is there any other way to solve this problem?
Thank you in advance.

"Smile2JP" <[email protected]> wrote in
message
news:gmqtde$fbi$[email protected]..
> Hello everyone,
>
> I'm having a problem to make my Flash SWF working in
Flex. I created an
> animation movieclip, made a button and wrote a script to
play this
> movieclip in
> Flash. Everything works fine but when I use SWFLoader in
Flex to integrate
> this
> SWF in my application. This "play" button is working
anymore in Flex.
>
> Should I remove the button and script in Flash and put
them in Flex? How
> could
> I write the script in Flex to call a function to play
this SWF?
> Is there any other way to solve this problem?
I have an example on my blog that demonstrates controlling a
Flash movie
from Flex:
http://flexdiary.blogspot.com/2009/01/example-of-casting-contets-of-swfloader.html
I included links to more basic examples in the code, so you
might find one
of them helpful even if this isn't.

Similar Messages

  • How to insert a shoutbox and a counter in a flash file with html code?

    How to insert a shoutbox and a counter in a flash file with
    html code?
    Code shout box
    <!-- BEGIN MYSHOUTBOX.COM CODE -->
    <iframe src="
    http://489676.myshoutbox.com/"
    width="152" height="300" frameborder="0"
    allowTransparency="true"></iframe>
    <!-- END MYSHOUTBOX.COM CODE-->
    Code compteur
    <script type="text/javascript" src="
    http://www.123compteur.com/counterskinable01.php?votre_id=268303"></script><noscript><a
    href="
    http://www.123compteur.com"
    target="_blank">compteur</a></noscript>

    thx =D

  • Flash swf componrnt button color changing by flex script

    i have a swf button created in flash which is used in flex.
    the button has got an arrow which is initially black, now i have to
    change the color of that arrow dynamically. i know flex a little
    bit but dont know flash.
    i have the source - fla - file of the swf too, where there is
    a button symbol - the arrow - in the library, but i dont know how
    to access that symbol from flex and change its properties.
    thanks in advance.

    Small detail:
    because you are embedding the swf as a whole, the datatype of
    content is MovieClip. So with your code you are downcasting the
    datatype to DisplayObjectContainer. The inheritance chain:
    MovieClip -> Sprite -> DisplayObjectContainer ->
    InteractiveObject -> DisplayObject -> EventDispatcher ->
    Object
    Your code works because 'transform' is an inherited public
    property of DisplayObject. But if you needed a method like
    gotoAndPlay() the downcast to DisplayObjectContainer would prevent
    this since gotoAndPlay() is a member of the MovieClip class.

  • Flash SWF with Video file will not play in web page

    Hello Flash group,
    I have created a flash video file from a *.wmv file.
    myvideo.flv.
    I have used flash to build an swf file that plays the video
    (with a default skin).
    I have then imported the media file into an html page using
    Dreamweaver. I did not import the flv file, but the swf file with
    the "video" in it.
    The page plays find on my development server (where
    Flash,Dreamweaver, etc is installed).
    When I moved the html page, the flv file, the swf file and
    the skin to my production webserver (linux and apache)
    the flash files do not show up on the web page. The dev
    server is a windows XP running apache 2.2)
    Any ideas on what I need to do???
    thanks,
    eholz1

    It may cause by any of the reason below:
    - You have uploaded the flv file to the wrong directory
    - Your flv file path/name is incorrect. check all case
    sensitive etc.
    - Your web server doesn't support FLV MIME type.
    Another similar topic here:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1263131&highlight_key=y&keyword1=MIME
    Hope it helps.

  • Create a user profile Flash SWF with a database?

    I have a project to create a SWF game, that requires registered users pegged to a database (eg: student ID and class) to logon to the SWF and play the game, and then they can save their progress and continue it next time.
    Below is just a sample that I did of how it might look like:
    What's the best possible way to create a database that can be linked to a logon page like this, and how can i make sure the game progress is saved, so that the student can access it from any computer?
    I'm very new to this, as my Flash knowledge doesn't extend to ActionScript 3.0. Would welcome ideas and tips. Thank you!
    Soph

    OK, let's begin with your db first  - 
    From your OP you are using UserID and Class as login credentials, so I've made these fields in the user table.
    The gstate table will eventually hold the users current game state.
    Copy & Paste the following to create a db with two tables into the SQL section of phpMyAdmin or similiar and press Go:
    create database if not exists `genogram`;
    USE `genogram`;
    /*Table structure for table `gstate` */
    DROP TABLE IF EXISTS `gstate`;
    CREATE TABLE `gstate` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `gID` varchar(100) NOT NULL,
      `gState` varchar(200) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    /*Table structure for table `gusers` */
    DROP TABLE IF EXISTS `gusers`;
    CREATE TABLE `gusers` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `uID` varchar(100) NOT NULL,
      `class` varchar(100) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    Once you have done this, you can enter userId and class details into the gusers table using phpMyAdmin.
    Let me know when you've got this far.
    Does your game have a fixed method of completion, or can the user complete it anyway they want?
    This will affect the way you store the users current game state.
    Best Regards
    thefeldkircher
    Message was edited by: The Feldkircher

  • Flash CS4 Trial not producing SWF with ActionScript

    After installing Flash CS4 (the trial), it has appeared that
    when compiling saved FLAs no longer produce SWFs with AS3 code.
    AS1/2 works fine, and compiling a Untitled-1 document works fine,
    it is just saved AS3 FLAs. Even FLAs saved with Flash CS3 that work
    in that product no longer work in Flash CS4.

    if you really started the installation and it installed halfway through or similar, run the cleanup script which can be found here: http://kb2.adobe.com/cps/406/kb406241.html and reinstall CS4 again, this time download it with a different browser if possible.

  • Flex swf loaded in Flash swf

    Hi,
    I have a Flex swf loaded into a Flash swf.
    I have made the Flex swf transparent, so that the buttons in the Flash swf are visible.
    But im unable to interact with the Flash swf buttons.
    My Flex swf is working happyily
    The Flex swf overlays the Flash swf.
    If i change the scrollRect of the Flex swf so the Flex swf is not overlaying the Flash swf i can successfully interact with the Flash swf buttons.
    Any ideas?
    Regards,
    Kyle

    Thanks Alex,
    I actually found an old post on a forum where you recommended a similar solution (mousesheld.visible = false).
    This seems to work although it messes with dragging (my Popups at least).
    But i can work with that for now, thanks for your help.
    Regards,
    Kyle

  • Integrating Flash swf or html with Dreamweaver

    I created a swf file to replace my current static background image (page properties) in dreamweaver (the files are the same dimensions). When I try to select it, the swf file is grayed out. So I deleted the background image and inserted the flash swf with a transparent bkgd. When I preview it in my browser (safari) it doesn't work. I like the position of the static file and would like the swf to stay in the same place to compensate for different user monitor sizes. Please Help!!!!
    The current/live site is http://www.sistercirclemedina.com you will see the static image (header_11_01.jpg). I added the revised homepage (index.html) to my site you can find that at http://www.481gddr.com/sistercircle/index.html  The script files required are in a script folder on the hosting server. I also inserted the swf into a completely new dreamweaver document and it does not work.
    If the swf file won't work...why? Should I try to use the js and input that into the dreamweaver code?
    Thank you so much for your assistance and time.

    Check, if all the paths in your projects are "relative" paths.
    If you drag&drop files or link in dreamweaver, DW will most likely use absolute paths.
    Then when you upload  your files, some of this paths won`t exist.
    I also inserted the swf into a completely new dreamweaver document and it does not work.
    You cant really "insert" a swf into a dreamweaver document.
    DW in this case does nothing else then telling the browser (via the <flash> tag where to find the swf. that has to go into a <div>

  • Can someone pls help me to change AS3 code to AS2 code

    Hello! Dear All,
    I dont understand why with AS3 code my swf file is not working smooth at all. I would like to try it with AS2. In publish setting when I am selecting Flash Player 8, AS2 my swf is running good but showing lots of code errors.
    I dont have much knowledge about AS2 so if someone can help me with this...it would be great.
    Thanks,
    Cheers!
    Code1:
    import flash.external.ExternalInterface;
    ExternalInterface.addCallback("GetVars",GetVars);
    ExternalInterface.addCallback("SetVariable1",SetVariable1);
    function GetVars():Array {
    return [
      {VariableName:"SetVariable1",DefaultValue:"Variable1"}
    function SetVariable1(variable:String):void {
    for (var i:int = 0; i < numChildren; i++) {
      var mc:MovieClip=getChildAt(i) as MovieClip;
      if (mc!=null&&mc.name=='Audi_Cup') {
       mc.variable1=variable;
       mc.SetVariable1(variable);
    Code 2
    this.mask_mc.cacheAsBitmap=true;
    this.mask_mc.cacheAsBitmap=true;
    Text1.mask=(mask_mc);
    function SetVariable1(variable:String):void {
    if (variable!=null) {
      for (var i:int = 0; i < numChildren; i++) {
       var mc:MovieClip=getChildAt(i) as MovieClip;
       if (mc!=null&&mc.name=='Text1') {
        var object:TextField=mc.getChildByName('InputTextField1') as TextField;
        if (object!=null) {
         object.text=variable;
    SetVariable1(this.variable1);

    it's possible, but unlikely, you'll fix anything by converting to as2.  so, what problems are you having with as3?

  • Loading SWF with audio playing in it...

    I was loading a SWF file, and noticed that even if I didn't
    add it to the display via addChild() that I can hear the audio
    playing in it. Why is this? And likewise, when I do addChild(), and
    see the SWF, then later use removeChild(), and no longer see it, I
    can still hear it playing.
    I can sort of understand that even though it's not displayed
    until using addChild() that one would HEAR it, because it is loaded
    - correct? But how would I actually get rid of/delete this when I
    no longer want to see/hear it ?

    Thanks to the both of you! I'd like to see the things you do
    to "close up shop" on the loaded SWF.
    I also found something about getting access to your loaded
    SWF here:
    TextAccessing
    document class of an externally loaded swf with AS3
    That blog describes adding a generic object in the complete
    listener:
    var loaderInfo:LoaderInfo = e.target as LoaderInfo;
    var myLoadedSWF:Object = loaderInfo.content;
    You can then target myLoadedSWF and access your SWF. Seems
    pretty different than AS1 & 2, but I suppose that's how it is
    (unless there are better ways).

  • Arabic project in CS3 with AS3

    dear friends,
    i need to create an arabic project in flash CS3 with AS3 coading. i am using normal version of flash. i need your advice,
    1) do i need middle east version to type and get arabic text?
    2) if i can use the same software and show the arabic text or enter the arabic text in run time what should i do? pls advice me.
    tell me how can i manage with the existing software and do the arabic project. i typed arabic text in this CS3, al the text is coming as broken, output also broken.  pls help me..
    Thanks in Advance,
    Syed Abdul Rahim

    Hi Syed,
    You need to install Adobe Illustrator ME (Middle East Version), otherwise the arabic text will appear as detached letters.
    Adding arabic fonts will not do the trick by itself.
    As far as i know, there is no other way, and i am not sure if there is Flash ME.
    And in case you cannot get this version you could always try typing it in MS Word and tracing it in Illustrator or Flash.
    Regards,
    Marc

  • Not resizing my file flash.swf

    Hi,
    I would like to know how I can do
    to not resizing my file flash.swf as you can see on the link below
    (I don t want the audi car to become smaller and smaller
    when you make the window smaller it is why I would like
    my file flash.swf always at the same size (same height and same width)
    and the audi car always at the center of the flash file)
    http://s371298467.onlinehome.fr/jc/
    Thanks in advance

    thanks ned
    but if I use fixed size (width:920px and height:350px)
    we can see that the grey ground under the car is no longer going on each both side of the screen.
    http://s371298467.onlinehome.fr/jc/
    I am trying to be more clear lol:
    I would like to have my flash.swf  with a height of 350 px but I would
    like to have my flash.swf always occupying all the space in the width
    between the left side and the right side of the window whatever is the
    size of the window and in the same time I would like to have
    my car always at the width-center of my flash.swf so at the width-center of the window and always at the same size(my car).
    thanks in advance

  • I am a Flex/AS3 coder who is puzzled about basic Flash

    Hi there,
    I am a FLEX coder with 6 months experience by way of Flex
    Builder. Coding business apps in AS3 is no big deal to me. The
    thing is, is that I am on a new project that uses Flash... and I am
    confused so I am looking for a bit of help.
    Others on this project have created FLV movies - that is, the
    ones like you see on Youtube. They created them by shooting the
    content with a digital video camera and encoding it into FLV. What
    I need to do add some logic to the movie, such as detecting where
    in the movie it has been played to.
    Do I need to create a new Flash program to load that movie?
    If so, how do I load it? Would I need to create a new interface to
    run that movie in, or can I just use the existing movie as the
    interface?
    I understand that if a movie has "labels" at particular
    points in time, I can add an eventHandler to respond to the labels
    being triggered. But can I add "labels" to an existing movie?
    Would I compile my Flash program with mxmlc, like I do in
    Flex?

    just in case you never got an flv file working in
    flash......here's some code.....jus copy and paste on the first
    frame of the main timeline....ie....open new fla.....select first
    frame.....press F9...(shortcut for actions panel) paste this code:
    var video:Video = new Video();
    addChild(video);
    // pass null object cus you're not connecting to a
    server.....if you are....put in address
    var connection:NetConnection = new NetConnection();
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    video.attachNetStream(stream);
    stream.play("smoke.flv");
    //the end
    Change that smoke.flv....to whatever file thats on your
    computer and save file as whatever you call it....and run file...
    if you dont know how to run.......just hit (ctrl+enter)
    ........ewww....its sleepy time for me.....
    ...any other questions....while i'm on :D

  • Calling flex functions from flash swf (AS3)

    Hi all, i'm stuck with communication between loaded AS3 SWF
    from Flash and Flex3 project. I use SWFLoader for runtime loading
    SWF, call functions inside SWF, but cannot find the way to call
    functions declared in Flex project. I try to use ExternalInterface
    class, but it does not help me, or maybe i use it incorrect. Is
    there a method to call Flex user declared functions from Flash SWF?
    All i need is a syntax sample, thank you in advance!

    Also, application.application will point to the top-level app
    scope, even from a loaded swf.
    I believe parentApplication will resolve to what you usually
    want as well.
    For looser coupling, consider using a bubbling event.
    Tracy

  • As3 code to support swf player with control buttons

    i need code for swf player.the player consists of play, pause ,stop, next and previous with seek bar and time control.i had try my code which not support my swf ......the code is ............
    function swfLoadedHandler(e:Event):void {
    trace("swf loaded");
    currentSWF=MovieClip(swfLoader.content);
    playerSwf.btForward.addEventListener(MouseEvent.CL ICK, button_forward);
    playerSwf.btRewind.addEventListener(MouseEvent.CLI CK, button_rewind);
    playerSwf.btPause.addEventListener(MouseEvent.CLIC K, button_pause);
    playerSwf.btPlay.addEventListener(MouseEvent.CLICK , button_play);
    currentSWF.addEventListener(Event.ENTER_FRAME , checkLastFrame);
    function checkLastFrame(e:Event):void {
    if (currentSWF.currentFrame==currentSWF.totalFrames) {
    currentSWF.stop();
    playerSwf.sliderMc.width=(currentSWF.currentFrame/currentSWF.totalFrames)*140;
    function button_forward(e:Event):void {
    currentSWF.nextFrame();
    function button_rewind(e:Event):void {
    currentSWF.prevFrame();
    function button_pause(e:Event):void {
    currentSWF.stop();
    function button_play(e:Event):void {
    currentSWF.play();
    swfLoader.load(swfFile);
    playerSwf.container.addChild(swfLoader);
    function closePlayer(e:MouseEvent):void {
    playerSwf.container.removeChild(swfLoader);
    removeChild(player);
    pls help me with another code to run my swf with player.....and i had attached my swf and player pls help me frds........

    Make your code agree with your file's setup.  If the file you provided for viewing is the file that the code is not working with, it is understandable since the code does not reflect the elements of that file.  Especially since there is no such code in that file, but also because if the code you showed was in that file, it does not target objects properly... mostly due to the lack of an object named playerSwf that your code uses to target all the objects thru.

Maybe you are looking for

  • IMac to TV connection

    We recently acquired an LG and a Sony Bravia TV, both with Internet connections. The Sony is successfully linked to our wired home network and we hope the LG soon will be. We would like to be able to view pictures and possibly video from our iMacs wi

  • Re: how do I set up my printer to only print in black?

    I have Windows 7 with the HP3522 All-in-one printer.  I tried to set it to print in black inly & it won't accept the change.

  • JSF Portlet default view (FacesPortlet)

    If we are creating a JSF based portlet using Sun's JSF RI and jsf-portlet bridge, then in portlet.xml we define this: {color:#0000ff} <portlet> <portlet-name>myPortlet</portlet-name> <portlet-class> com.sun.faces.portlet.FacesPortlet </portlet-class>

  • How to change source system in SAP BI

    Hi, In Sap BI we are having a source system ECC1CLIENT100, based on this we developed all the data modelling, now due to some reasons we made a copy of the souce system ECC1CLIENT100 to ECC2CLIENT100 and we removed ECC1CLIENT100 from SAP BI connectio

  • N80 firmware upgrade: No upgrade available.. not t...

    The nokia software updater for my N80 IE say no update available but it's not true . My firmware on N80 IE is v.40707.0.7 28-3-07 rm 92 I need to upgrade to 5.0719.0.2 , but when i try to update them essage says :" Not update available" . Where do I