Error #2136: The SWF file

I am trying to learn how to use classes. The book I use gave me this example.

In Vechile.as

package {}

import flash.display.MovieClip;

import flash.events.Event;

Vehicle/public class extends MovieClip {}

public var _gasMileage:Number;

public var _fuelAvailable:Number;

public var _milesTraveled:Number = 0;

public var _go:Boolean;

public void vehicle (mpg:Number = 21, fuel: Number = 18.5) {}

_gasMileage = mi/gal.

_fuelAvailable = fuel;

this.addEventListener (Event.ENTER_FRAME, onLoop, false,

0, true);

}

public void onLoop (evt:Event): void {}

If {("go-ahead")

-_fuelAvailable;

_milesTraveled += _gasMileage;

If (_fuelAvailable < 1) {}

this.removeEventListener (Event.ENTER_FRAME,

onLoop);

}

trace (this, _milesTraveled, _fuelAvailable);

This.x = _milesTraveled;

}

}

public void go (): void {}

"go-ahead" = true;

}

}

}

In the main.fla

Framework 1

var: = new Vehicle vehicle (21,18.5);

addChild (vehicle);

Vehicle.Go ();

When I compile it gives an error output.

Error #2136: The SWF file file:///C|/Users/Ravenwind/Documents/Main.swf contains invalid data.

in Vehicle / frame1)

I'm stumped

' I don't then assign vehicle to document class box in the property ' Do not assign the vehicle that the document class... out of the way.

In the main file, if you don't already create one, create a movieclip symbol (just draw a shape in there at the moment).  Right click on the symbol in the library and select the link.   In the interface that appears, select the export for Actionscript option and give it the class name "Vehicle" in the field labeled 'Class'

Make sure that you save the file Vehicle.as once you put the code in it and have this file in the same folder as your Main.fla file.

If you do the things that I just you describe should see an instance of movieclip, which cross the scene when you run the file.

Tags: Adobe Animate

Similar Questions

  • Firefox does not display the .swf files

    Hello

    Everything worked quite well in Firefox and then all of a sudden it stopped simply to display .swf files. Where they should be is simply empty. On Web sites with a background, I can see the background through where the .swf file should be. This includes the locally saved files as well as all Web sites with a .swf file that is supposed to play.

    I don't want to suddenly quite literally, as it was in the middle of a browsing session. I changed nothing, just... one minute they worked very well, the next they completely arrested. It is clear that the program is to recognize that something is supposed to be there, like Adblock appears a little tab 'Block' on where the file should be, but again, this space is completely empty. He's not black, it is transparent.

    I completely uninstalled reinstalled from zero and 'upgrade' Shockwave it three times now, all without effect.

    You can check for problems with the current versions of the plugin Shockwave Flash and try this:

    See also:

    Start the computer in safe mode Windows with network support (on the startup screen, press F8) to see if it has an impact.

  • questions to open the .swf files

    At the opening of the .swf files I open or save as options. I tried all the fixes I could find nothing help. I even tried reinstalling the flash player program. I can read the files from the site, but after downloading, I can no longer read the files from my desktop without having to open it or save as options as it tries to re - download the same file. This repeats non-stop. I checked the options in tools but I can't seem to change or reset things to the .swf files. One of the options for the target of shockwave flash file, which I installed it, but the other says always ask. I can't change to firefox, if I set it to IE he repeats the open or save as options as it does in firefox. I can't locate any program to open the file in firefox.

    Before the last update that I use to just be able to click on a .swf file and it will open in firefox without problem. I don't know what has changed in the last update, but now I can't open the .swf files unless I do it from the site, I downloaded the file from.

    Try to rename (or delete) the file mimeTypes.rdf in the profile folder of Firefox to reset all the actions file.

  • Error 1335 the Cabinet file

    Hello

    When I install Microsoft Flight Simulator X, I get the error message 1603. But before I got this messase that I get an Error 1335 the Cabinet File "D1 ~ 10.CAB '.

    I copied all files from drive 1 and 2 on my hard drive and I still get the same message.

    Help, please

    Hello

    Cabinet (or CAB) is a file format to archive for Microsoft Windows that supports compression without loss of data and embedded digital certificates used to maintain the integrity of the archive. CAB files have .cab file name extensions.

    Install the game in the clean boot and check if it helps.

    To help resolve the error and other messages, you can start Windows XP by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to configure Windows XP to start in a "clean boot" State

    Note: follow step 4 to reset the computer to start as usual after the boot process.

    Hope this information helps.

  • Download error. The downloaded file has no verification. Code of error = 0x80040507__Google Chrome Installer

    Hello. I have a problem that I recently received these messages on computer blue screen comes and goes... (bsofd) when im using the internet only. Told me to stop using ie 8 and google chrome but when I tried to download it it was the message that I received... "Download error. The downloaded file has no verification. error code = 0 x 80040507 ". I have windows xp... SP3. my hardware is dual cpu, 2 GB ram, 1 TB hard drive and 512 graphics card. Please help me

    Hi Arvind,

    You try to run chkdsk on the machine and check if the problem persists.

    How to perform disk error checking in Windows XP

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • The best way to perform checks to find errors in the system files on a regular basis?

    What looks like the best of fashion to plan the audit of the system partition
    the presence of errors in the system files and bad sectors on the system partition?

    Tasks scheduled by Vista?
    Vista help recovering all documentation of chkdsk,
    so I'm afraid it is supported under Vista?

    Hello

    read the information below about

    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    and also that

    Run the sfc/scannow command.

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms,Accessories, right-clickguest, and then clickrun as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions

  • The problem "your current security settings do not allow this action" when I want to open the swf file in Windows Media Player.

    How to solve the problem when I want to open the swf file in windows media player? There, half year, when I click on a swf file, it could automatically play in Windows Media Player.

    Now when I want to open a SWF with Windows Media Player, it pops up a window "your current security settings do not allow this action".

    How to use watch the video in Windows Media Player swf?

    Hello

    SWF is a file format for multimedia, vector graphics and Action Script in the Adobe Flash environment. Origin with future Wave Software, then transferred to Macromedia and then coming under the control of Adobe, SWF files can contain animations or applets of varying degrees of interactivity and function.

    SWF functions as the dominant vector "animation" on the Web for graphics display format. It can also be used for programs, games by browser commonly, using ActionScript.

    Method 1:

    I suggest open he file in Internet Explorer and check to see if you encounter the same problem.

    Method 2:

    Step 1:

    You can also try reinstalling Flash Player on the system to fix the problem.

    To uninstall a program in Windows 7 refer to the link below

    http://Windows.Microsoft.com/en-in/Windows7/uninstall-or-change-a-program

    Step 2:

    Once you uninstall Flash Player reinstall rear and check to see if you encounter the same issue.
    To download the latest version of Flash player refer to the link below

    http://get.Adobe.com/flashplayer/

    Once you download Flash Player see the link below to install a program downloaded in Windows 7.

    http://Windows.Microsoft.com/en-us/Windows7/install-a-program

  • Download this message when I try to run Lightroom. Point procedure entry AgTransitCargo_pushTransitCargo could not be found in the AgKernel.dll dynamic link library - system: windows 7 64 bit is no error in the log file

    Download this message when I try to run Lightroom. The procedure entry point AgTransitCargo_pushTransitCargo could not be found in the AgKernel.dll dynamic link library

    system: windows 7 64-bit

    There is no error in the log file.

    no error in scannow at the command prompt.

    errore lightroom.jpg

    Hi Michela,

    Lightroom makes a call the the AGkernel.dll file, but the file isn't sure what to do because it can't find the line of code within himself to answer. This can happen for several reasons, that fall within these two broad categories: AGkernel.dll is damaged and must be repaired or AGKernel.dll version is incorrect and should be updated to the correct version.

    Here are some things you can do to fix the file:

    -Record again with Windows AGKernel.dll: https://support.microsoft.com/en-us/kb/249873

    -Windows repair: https://support.microsoft.com/en-us/kb/929833

    -Install all the updates that are available for Windows: Windows Installer updates

    -Uninstall and reinstall Lightroom

    Kind regards

    Tanuj

  • Packer of creative cloud in creating a package that I can install do not.  He goes through the motions, download all updates, create setup file, but it does not work despite the fact that there are no errors in the log files

    Packer of creative cloud in creating a package that I can install do not.  He goes through the motions, download all updates, create setup file, but it does not work despite the fact that there are no errors in the log files

    After hitting my head against the desk to repeatedly create packages, try on different computers I have finally found a solution.

    These packages have been copied on an external drive, if I try and install from the external drive, which is a common practice, it fails.

    If I then copy this file pkg from the outside, to the computer I install, then run it, it will to and moved very well.

    That is mind-boggling stupid, because it's rare that you have to copy the file into any computer, it is less always installed off the coast of externally, and many people in the company are pushing on the network and the management of the suites so there is a serious problem in Adobe package manager if this is the case where it cannot manage the Middle installed offshore.

    I hope that if anyone else is having problems so it suits.

  • Presentation of the SWF file

    Hello

    What is the best solution for the presentation of the SWF file on computers that have not installed FLASH player?

    There is none. Flash is owner and using little flavor of Flash player is inevitable.

    Mylenium

  • Display next button after the SWF file embedded is over

    I have a SWF file (AS3) I'm embedding in Captivate 7.

    I have the commands in the file SWF Captivate a pause until the SWF is done playing, then he will resume the Captivate slide at the end of the embedded SWF file.

    I would like to be able to trigger the 'Next' button on the blade so that it appears when the SWF file is finished.  I've included a variable 'videoDone' on the blade and the SWF successfully assigns to the variable '1' when it is complete.

    So far so good, where I'm having a problem is makes the following button.

    Is it possible for me to tell Captivate to show the button next to the SWF embedded? Or is there a way I can add a listener for the Captivate slide as well as when the variable "videoDone = 1" it will show the next button?

    I managed to solve the problem by having 2 following buttons

    #1 on show/hide slide entry based on the 'videoDone' user variable
    #2 placed lower in the timeline panel and looks after the SWF file finishes.

  • Export interactive PDF in indesign, with the animation of the edge to the SWF file?

    Hello

    I have an interactive pdf in indesign with animation, works very well when they are exported to the swf file.

    I need to use more complex animations that Indesign has, so I created some new features of Adobe Edge animate, exported save them as a file .oam and then put them in the Indesign file.

    If I use the Preview on the animation tab I see indesign animations and the edge, but if I export it to a SWF file is - this only animation to indesign working, and if I export to epub file is only the edge animation work.

    Somehow it is possible to export so that the two works of animation types. and it is possible to do it in a SWF file.

    I have Creative Cloud 2014 for both programs

    Thank you!

    NO.

  • When I change the main mxml file in the project and then export the swf file does not change, why?

    I have an existing project, years ago that I need to change, I am using Flash Builder 4. When I export the project, it creates a SWF in bin-release, then when I change the code in the mxml project file or files of any format and export the swf file needs to change, but it's not. You have an idea why this might happen?

    Thank you

    I found the problem, there was a SWF into the html-template folder within the project. This has led to substitute the swf of the new generation.

  • Captivate 6 graphic bug in the SWF file

    Hello

    I use 6 Captivate and have a problem with the SWF file. There are some glitches in the video. They are a bit like after images of the contents of the previous slide.

    bug.JPG

    (Here the white lines should not appear).

    Curiously, in the preview of these lines do not appear.

    I already tried a lot of things like the use of the highest quality for slides (24-bit) or increasing the frames per second, but nothing seems to help.

    Does anyone know a solution?

    Kind regards

    Rini

    Hello and welcome,

    You can specify the exact version number (help, Captivate)?

    Try turning off all compression under preferences, project, SWF size and quality settings. And what publication check the option 'Force republication... '. »

    Lilybiri

    PS increasing the pace will not help in this case.

  • If sendAndLoad() returns correctly in the swf file, but not when they are incorporated...

    If sendAndLoad() returns correctly in the swf file, but not when they are incorporated, does this mean that I am missing something in my html code?

    I use generic Flash embed code generated from Dreamweaver.  I can post more information if necessary.

    Thank you

    Peter

    peterbrinson wrote:

    Very useful.

    Is it because my swf/html and the database are in very different places?

    Yes, they are in different domains and adobe imposes restrictions on what a swf file can do with the data from one server to another (from the swf) area.

    Are you talking about a PHP or ASP file that integrates the swf?

    lol you create an executable file on the same server that hosts your swf.  This executable can query your database and not trigger cross-domain issues.

    your swf file can send and receive data from and to this executable without triggering cross-domain issues.

Maybe you are looking for

  • My iTunes store is all black with the exception of the photos in the album

    Hey there! I have problems to display the iTunes store. Currently, it looks like this when I open: Despite the usual suggested correction of resizing of the window and the screen resolution (my screen resolution is 1920 x 1080) by train, it remains t

  • Some "keyboard shortcuts" does not work on Satellite A200

    Hello people... I installed windows XP in my Toshiba Satellite A200-1js and e do the downgrade to bios for the work of the FN key... but higher like play, stop, next track and back keys track left for work... This was the solution? Thank you

  • Graphics card compatible for my 3000 H100 8789 Q61 Office

    Hello people this is dev once again, I hope that all do you fine I have lenovo Desktop 4 years old model No. 3000 H100 8789 Q61, I add graphics in there, now, my questions are It is pausible add a compatible graphics card in my motherboard? If Yes, w

  • PROBLEM WITH THE INSTALLATION OF UPDATES

    When the computer tells me to reboot to complete the installation of updates, I do.  It stops normally, but when he tries to restart, the screen goes completely dark.  I have to press the market / stop button for 4 seconds & it stops.  I wait a few m

  • Expandable HP 15-d069wm or Pro graphics card. ?

    Hello, I recently bought an Hp touchsmart laptop computer 15-d069wm I would like to know it, it would be possible for me to update my graphics card and also upgrade my Core i3 Pro to an i5. ? Thank you