Using SWC

Hello

I have a simple CFC that is defined as such. And named ct.cfc

< cfproperty >
<!-Celsius to Fahrenheit conversion method. ->
< name cffunction = output "ctof" = "false" >
< cfargument = "temp" required = "Yes" name type 'number' = >
< cfreturn ((temp*9)/5) + 32 >
< / cffunction >
< / cfproperty >

Then I have a .cfm file named test.cfm and the cfc file and the cfm file are in the same directory. The test.cfm file is below:

< ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""
< html >
< head >
< meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 ">"
< title > Untitled Document < /title >
< / head >
< body >
< cfscript >
obj1 = createObject ("component", "ct");
obj1.ctof (temp = 100);
< / cfscript >

< / body >
< / html >

I can't understand how to print the output of obj1 on-screen. I tried obj1.temp and it does not work. Also, all of the code above does not throw an error. It's only when I try to cfoutput the value that I meet problems. So, how do I print the value? It should be 212.

Thank you

Jim

Use it as an example.

then later I was say 200 lines:

#x #.

A: right, while it is

then later I was say 200 lines:

#x #.

What you trying to do? Who will define the variable 'x' to be a copy of the value returned by the method of your PPC. You can then repeatedly use variable said without actually running again the method.

Tags: ColdFusion

Similar Questions

  • Using SWCs created in the Flash IDE as RSL?

    Hi all, not sure of the best way to address the issue.

    I work with a pure Actionscript project in FB4. I have a lot of work in the UI created in the Flash IDE. I compile them all in a SWC and then add the code for them by extending them with another class, for example:

    (in art.swc, generated by art. FLA)

    assets. Foo_display extends Sprite

    (in the main project)

    class Foo extends Foo_display

    {

    Add the behavior of code here

    }

    Now, this works very well as long as I include art.swc as a normal library (i.e. "merged into code" in the project properties). However, what I really want is for art.swc to be an RSL that I dynamically load. However, FB4 don't mark the CFC as a repetitive stress, as an "external library.

    It's all nice and good - I know how to manually load the art.swf when running. However, here is a problem: my main project (which compiled into main.swf) contains a definition of class that depends on the Foo_display. When I run main.swf I get a VerifyError because (I think) Foo_display is not loaded in the ApplicationDomain yet. Shit!

    So, should I write a preloader to load art.swf before I even think about running main.swf? The goal here was to delay load art.swf for a little while. I don't know much about RSL, but I feel that they do not have this restriction (i.e. the player will go forward and check the swf file and let you worry about the actual code to load before using it). Is this true?

    Interesting side-note: the auditor seems not to care about instances of classes, just trees of heritage. So in main.swf, I can create instances of Foo_display all I want and the system is not complain until I loaded art.swf into the current ApplicationDomain before I do. However, if I have the classes that inherit from Foo_display - BAM, VerifyError. Anyone know why this is?

    RSL receive no special treatment of the player. I think the VerifyError missing dependencies of legacy, is part of the virtual machine and is described here in Chapter 3, http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf.

    -Darrell

  • Best practices for the universal iOS app? SWF or SWC?

    Hello

    I'm trying to draw a box for my property which helps keep memory low load at run time for an application universal iOS and ran across the following article about the swc files.

    http://www.flashrealtime.com/compiling-big-air-SWF-to-iOS/

    However, it is not clear how this method would be beneficial from a point of view of memory. The files don't always loaded in execution?

    Or should I look at the swf files with code deleted and marked from the main swf in the ipa? (sounds like more work!)

    Please help educate a noob!

    Thank you!

    Some files may get loaded during execution even if you use swcs (video, xml, etc.), but the content that has traditionally been loaded as a swf should be compiled in your main swf.  This is not because it is more efficient, it's just to get around restrictive TOS of Apple memory.  So rather than load a module.swf in your application, you instantiate class of the module.swf document the same way you instancierait any other class, and instead of unloading it when you want to free the memory that you need on a null all references to that object (and all the objects that it created) cannot be reclaimed by garbage collection.

  • URGENT - Facebook connect you in Flash game

    I have a problem of application of the Flash API in my game... I tried to open one of the examples of the API, I put the last source API files in the folder and it gives me errors in the source files...

    https://code.Google.com/p/Facebook-ActionScript-API/ It's API, I tried.

    If anyone knows how to implement Facebook connect in a game, please help...

    This is an excerpt from a recently published book, I wrote (http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=gladstien):

    The Facebook API of ActionScript Adobe also uses the class ExternalInterface and JavaScript to communicate with Facebook, so you should always use the swf including code that is compatible with the ExternalInterface class. Adobe uses SWFObject (http://code.google.com/p/swfobject) to embed the swf file and injects the JavaScript code using xml and ActionScript. You can check the FacebookJSBridge class to see how it's done.

    At the time of this writing, the ActionScript from Facebook Adobe (version 1.8.1) code uses class JSON of Mike Chamber.  But if you are publishing for Flash Player 11 or higher, you must use the native JSON Flash class.

    The two JSON classes are similar because they are named the same and use static functions to convert to and from JSON format. When the class room JSON uses JSON.decode () and JSON.encode (), the native JSON Flash class uses JSON.parse () and JSON.stringify ().

    So, if you use Adobe Facebook ActionScript API and see

    1061: call to a method may not set encode through a reference with static type class.

    Errors, you need to replace JSON.decode () by JSON.encode () with () JSON.stringify and JSON.parse.

    To use the Adobe Facebook ActionScript API, go to http://code.google.com/p/facebook-actionscript-api and download the latest version of the GraphAPI documentation, examples, SWC files and source code.

    If you are publishing for Flash Player 11 or better, you will need to change all JSON methods in non - CFC files.  If you use swc files place source files, you will have less code to change.

    In support of the files/Chapter 11/facebook/fb2 are files that use the Facebook Adobe ActionScript API for the web. Code that uses the API is located in FlashWebMain.as.

    With only a few changes FlashWebMain.as (FlashWebExample.fla document class) is identical to the example file from Adobe with the same name. I've added details (in cbF, dialogsF and graphF) showing how to use the Facebook.ui and Facebook.api methods.

  • How can I dynamically load swc files using as3? (without relying on the Flash IDE).

    How can I dynamically load swc files using as3? (without relying on the Flash IDE).

    The SWF file can be used in the same way as the CFC, which means that you don't need to "visually show" anything when it is loaded. Your code can use the classes and assets incorporated into the SWF, just as a SWC file. So if someone just to load the SWF file to see what was in it that they see nothing. They could however access programmatically to what anyone on the inside just like you, if they went to that level. But it is not as easy as just racing as SWF to see what is inside.

    I hope that all packaging several separate sovereigns will allow you to load and unload only what you need to keep the RAM usage as low as possible with a minimum load SWF.

    If you are ready, please mark all useful/correct so we can filter without response. You're welcome and good luck!

  • Using swf files compiled as swc into a project of ios

    Hello

    I have a quite stupid question, but I'm going anyway since its not easy on iOS.

    I have 10 swf files (each file is 1 game with all the assets + as3 inside)

    I now have an iOS (air 2.7) application that can play these 10 games on selection.

    Normally on iOS its not allowed to load swf files with AS3 inside because you can't use interpreted by Apple.

    Now, on http://www.flashrealtime.com/compiling-big-air-swf-to-ios/ , I've read some info on something to use CFCS.

    Here's my question now.

    If each of my 10 swf files contains in fact 1 movieclip on the stage that, by itself, contains all the game logic (as3) and assets inside, so can I compile these 10 swf files to a CFC and somehow included in a big iOS app?

    For example

    game1.swf the main movieclip would be onstage and exported for actionscript under the name "game1_mc".

    game2.swf the main movieclip would be onstage and exported for actionscript under the name "game2_mc".

    game3.swf the main movieclip would be onstage and exported for actionscript under the name "game3_mc".

    game4.swf the main movieclip would be onstage and exported for actionscript under the name "game4_mc".

    ...


    So I can somehow include all swc inside my 1 big app files?

    And can I then somehow instantiate one of these movieclips and add them to the displaylist to start a game?

    This could solve a big problem for me, but I'm not sure if this is possible.

    Kind regards

    Bart

    Ultimately you have these things included in the main file, and the tips on this page may be more oriented towards users of Flex. If you use the Flash, you could go to each of the SADF and copy the movieclip draws in sound and paste it into the main swf library. Set it to share for ActionScrtipt and use a unique name. For example, you can set the name of the symbol shared at level 1. Then in your main code where you would normally load in the external swf, say you:

    var levelmc:MovieClip = new Level1();

    addChild (levelmc);

    It should work just as well as the whole thing be swc.

  • How to get strobeMediaPlayBack.swc use in flex?

    Hi all

    I am new to flex and flash. Our group has developed a silverlight with feature Player multimedia time text search. And we also want to do the same thing in flash. Hope you guys can give me a hand. Thank you in advance.

    Basically, I want to have such a player that: users can enter text and a button to trigger the sending (HTTP POST) to the server.

    Server then send back xml data and the player can analyze the data and display the text in time in a list (like cue point).

    Also clicking cue point the player will look to this post.

    I try to edit AS3 code in the StrobeMediaPlayBack and create the controls/widgets & logic inside the drive. But as I am new to flash, it is not easy.

    So I try to follow the StrobeMediaPlayBack towards a .swc file and add the control (such as the button, TextInput) & logic in mxml.

    I add the .swc file in a new flex project and write the code below in the .mxml file.  He get errors when I debug or run.

    Is this the right way to add 'object' in mxml (I guess that's not; <)? Can anyone help?

    Tank you

    Andrew

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark".

    "" xmlns:mx = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" xmlns:local minHeight = "*".

       >

    < fx:Script >

    <! [CDATA]

    ...

    ]]>

    < / fx:Script >

    < local: MyPlayer width = "1028" height = "540" >

    ...

    < / local: MyPlayer >

    < s:Button >

    ...

    < / s:Button >

    < s:TextInput >

    ...

    < / s:TextInput >

    < fx:Declarations >

    < local: StrobeMediaPlayback id = "myPlayer" >

    < / local: StrobeMediaPlayback >

    < / fx:Declarations >

    < / s:Application >

    Flex 4.0 has delivered an out-of-date version of the OSMF, and you must manually remove your project settings.

    Check that the release notes here http://opensource.adobe.com/wiki/display/osmf/Downloads (using OSMF with Flex 4 SDK framework) If you encounter problems.

  • Use a locally swc file to optimize the use of bandwidth for an LMS

    Hello.

    I have an LMS (learning management system), which also uses elements of the virtual world as avatars, games with great graphics etc...

    Bandwidth here in Spain is bad to say the least. Games like world of warcraft ship a CD to put heavy graphics on your local hard drive. It would be a great idea for our e-learning system. Is the best way to use a CFC which is impossible to decompile? It would save a lot of headaches.

    Well, what I'm trying to ask is how can I protect our graphics piracy if installed on the pc local users.

    Thank you in advance.

    You may simply want DRM. Here are some links to check out:

    Documents from Adobe:

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/FLA sh/net/drm/DRMManager.html

    The use of Adobe News:

    http://help.Adobe.com/en_US/AS3/dev/WSe3d2d52902616553-41317b6911d1b4b fb29 - 8000.html

    By the way, the images are data binary just so you can encrypt them with something fast like RC4, use a library, for example:

    https://code.Google.com/p/As3Crypto/

    Ultimately if someone REALLY wants your content, there is no 100% average hackproof. I would implement a reasonable attempt at DRM or encryption, but really measure against the performance hit you'll take to do, with the knowledge that you really cannot guarantee protection in any case.

  • When you use Device.device.os, it throws error #1079: native methods are not allowed in the loaded code.

    Hi all

    When I tried to use the Device.device.OS to get the string from the bone. It is compiled smoothly. But it throws error when the application started on my desk.

    Error #1079: Native methods are not allowed in the loaded code.

    It does not error in the emulator, but he did not get the chain of the OS.

    Someone knows how to use the device class? Is it still not currently supported?

    Thank you very much!

    Error #1079: Native methods are not allowed in the loaded code.

    This error is thrown on the desktop because your qnx - air.swc is probably in the process of fusion as code instead of being tied to your project as external. The reason who need to be external is that it contains classes that exist in the execution of AIR in the Simulator and not in the AIR runtime on your desktop. The device classes use the custom air extensions we wrote to get the properties of the device.

    If you want just the operating system, you can also use the Capabilities.os, which is a standard API Flash Player and does not require the use of custom extensions.

    My guess on why it does not work on the device thus is that the qnx - air.swc is not defined externally. Return to externally set and run it in the Simulator.

    Hope that helps

    Julian

  • Using events QNX in the AIR for BB10 in Flash Professional 5.5

    I want to use the QNX events in my AIR for BB10 application in Flash Professional. As the playbook, am I supposed to add a few swc files in order to use the events I get compilation error?

    I want to use "CardCloseEvent", but it gives compile error.

    Thank you!

    No worries,

    GoTo file > settings Actionscript > library path

    Press on the +, then navigate to the DONKEY

    Note: If it does not allow you to add DONKEY - make a copy and rename it to SWF.  He worked for Flash Builder 4.5.

    For each ALBUM, you may need to click on it and press the I button and change it externally.

    I don't know how Flash Pro builds your packages well-, but put in right place.

    Ed.

  • How to use qnx using CS4

    Hello

    I use CS4 for development flash playbook and want to use the native device PIN feature.

    So, I tried to use the QNX API in my project. But I am not getting any compile errors and so unable to use it.

    Source code changes->

    var myText123:TextField = new TextField();

    myText123.text = Device.device.pin;

    addChild (myText123);

    Changes in CS4->

    File-> settings-> flash-> settings publication->

    Library path->D:\TabletOS\blackberry-tablet-sdk-1.0.1\frameworks\libs

    External-> library path

    D:\TabletOS\blackberry-Tablet-SDK-1.0.1\frameworks\libs\qnx-screen\qnx-screen.swc

    D:\TabletOS\blackberry-Tablet-SDK-1.0.1\frameworks\libs\air\qnx-air.swc

    Error:

    Error #1065: Variable qnx.system::Device is not defined.

    Suppose that the device class is not found, but I am not able to find a way to include it.

    Thanking you in advance,

    Sumit.

    I was using CS4 which felt no option to import the SWC files and mark them as external. CS5.5 fixed the issue.

  • The use of components in MXML QNX?

    Hello

    I'm trying a Flex Mobile with Burrito project and that you want to use the components QNX as QNXStageWebView (or any other component QNX, in fact) but with MXML (I don't think that there is another way now to integrate a browser, please correct me if I'm wrong). Try using does not work... Is it possible to do it again?

    I think I've seen similar issues but I have not found a solution.  Someone has said that wrapping the QNX components in the UIComponet work wrapper ( http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/QNX-controls-and-Spark-MX/td-p/62... ) for them, but I'm not sure how to do this?  Someone did (and if yes, could you please share an example)?

    Also, if possible, are there downsides to doing this?

    Thank you!

    OK the use cases of the use of QNXStageWebView is easier, then make QNX UI components as has been said. To that end, here's how you would do it:

    Include the qnx - air.swc to a Flex Mobile project (0.9.0) (do not include the package to build Flex-> BlackBerry Tabel-> include libraries box as he immediately a compile error).

    
    http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark" title="Home">
    
        
            http://renaun.com";
                    webView = new QNXStageWebView();
                    webView.enableCookies = true;
                    webView.enableJavascript = true;
                    webView.enableScrolling = true;
    
                    webView.addEventListener(Event.COMPLETE, loadWebView);
    
                    webView.loadURL(url);
                }
    
                private function loadWebView(event:Event):void
                {
                    var startY:int = localToGlobal(new Point(btnClick.x, btnClick.y+btnClick.height)).y;
                    lbl.text = "Stage W/H: " + systemManager.stage.stageWidth+"/"+systemManager.stage.stageHeight+" - " + startY;
                    var rect:Rectangle = new Rectangle(0, startY, systemManager.stage.stageWidth, systemManager.stage.stageHeight - startY);
                    webView.viewPort = rect;
                    webView.autoFit = true;
    
                    webView.stage = systemManager.stage;
                }
            ]]>
        
    
        
            
        
        
        
    
    

    Complete code and write my post here:

    http://Renaun.com/blog/2010/12/using-Playbooks-qnxstagewebview-with-Flex-hero-mobile/

  • Change the color of the text inside the .swc library

    Hello

    I'm trying to Flash Builder 4.5 and got library external .swc (made with Flash and Flex components Kit) with some objects. One of these objects is a text field with the text. I need to change the color of this text and I don't know if it's possible. I tried to change the 'color' property, but it does not change the color. I tried "setStyle ('color', 0xff000)", but it returns an error.

    Is there another way to change the color of the text .swc of Flex/Flash Builder?

    Ask the DFL used to create the swc, so you can inspect.

  • Adobe Air + Box2D.swc = TypeError: Error #1009 / / new way of managing .swc files in Flash for iOS Apps?

    Hello

    I need your help please - I need to update one of my iOS Apps. In this application, I use Box2d for a simple maze game (this is an application for children). When I publish and test this game on my Mac it works fine. I can drag my hero (fish) in this maze and all detections of collision, gravity etc perfect work.

    maze.jpg

    When I test it on my iPad it does not work. The device debugger shows this error message:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    Global $init)

    Global $init)

    at Box2DAS.Common::b2Base$/initialize() [/ users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31]

    to wck::WCK/create() [/ utilisateurs/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/WCK.as:26]

    in misc::Entity/ensureCreated() [/ users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50]

    in misc::Entity/handleAddedToStage() [/ users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100]

    in misc::Entity/handleAddedToStage()

    Line 31: loader = new CLibInit();

    Bildschirmfoto 2014-10-23 um 21.06.03.png

    I guess that "CLibInit" must come from the .swc file.

    The thing is:

    I won't change anything in this maze game - it seems it has to do something with the new version of Flash or Adobe Air. File box2d.swc is included:

    Bildschirmfoto 2014-10-23 um 21.01.26.png

    It has always worked like that - and it works when test on my Mac - but it doesn't work anymore on my current system.

    So I started my Mac from an older system (10.9.5 on an external HD) and published the App in Flash and Adobe Air 13.0 CS6 - then all of a sudden, he is working on my iPad as before. I was able to draw a fish and make it arround.

    The same project / app released from my current OS X 10.10 + Flash CC 2014 + Adobe Air 15.0.0.302 does not work. I still have this error message - I can't drag the fish - nothing happens. And I have no idea why this happens and what I could do. I searched all day for a solution but found nothing.

    If nothing has changed by the way Flash and/or Air manages the .swc files? Is there another way to include: import cmodule. Box2d.* / CLibInit?

    -If someone has an idea - please let me know!

    Best regards

    Jan

    SOLVED!

    I uncheck 'Schnelleres Verpacken aktivieren (Beta)' and now it works again! Hooray!

    @ Adobe: Please take a look at this!

  • How can I use MapQuest API in Adobe Flash CC?

    Hi all

    Since Google Maps API will be deprecated in 3 months I am using instead the MapQuest. (MapQuest Developer Network: map APIs, SDKs, and Web service - MapQuest Developer Network)

    But I can't import the MQFlashMapsAPI_7.1.5_MQ_MOBILE.swc component in my project... No idea why?

    I read that I have to import the core.swc from the Flex SDK kit... I put the core.swc file in the components folder, but when I go in the components window in Adobe Flash, or core.swc or MQFlashMapsAPI are visible.

    You what should I do to import the MQFlashMapsAPI into my project?

    I use Adobe Flash pro CC

    Thank you for your help,

    I found the solution.

    You must place the swc file: C:\Program Files\Adobe\Adobe Flash CC\Common\Configuration\ActionScript 3.0\libs AND C:\Users\Name\AppData\Local\Adobe\Flash CC\fr_FR\Configuration\Components\Flex

    Hopefully it'll help someone else.

    Thank you for all your help.

Maybe you are looking for

  • P6674y Pavilion: Pavilion p6674y update graphic card

    I want to install a new graphics card in my former lodge. I'll add a new power unit - I prefer nvidia EVGa etc usually... does anyone know, or can anyone refer me to a url with this info?  I tried my radeon 5820 and she didn't any what exit, so I stu

  • Calendar of slow FPGA

    We have a compact device of cRIO-9072 Rio FPGA. 1 analogue out, analogue 2 in 1 race of SSR.  My program works well, but I can't get the cycle time for update reads to move faster than about 1 second / cycle. I perform a host VI and the target FPGA V

  • Icons are white or invisible at the start of windows 7.

    We have just upgraded a laptop Sony Vaio running Vista 32-bit Windows 7 Home Premium. There were not problems by installing the software and Windows loads fine but once it does all the icons on the desktop and in the menu start are either a box white

  • Problems to install iTunes on Vista

    I am trying to install iTunes 10.2.2 on Vista Home premium 32-bit. I get the error message ' there is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your personal support provi

  • Cancel "create/attach proxy"?

    Is it possible to detach my media high ground proxies so I changed my mind after the "creation of proxies" in the first 2015.3 new?I deleted the proxies, I did, and now when I double click on an element in a sequence, 'change it properties in offline