FlashVars + HTML Wrapper + Flex 2

Hi
Can someone please help me….
I am trying to use “flashVars” within my Flex 2
application…..
I am having trouble incorporating them into the wrapper (HTML
file) that is created by default when the flex application is
built….
When I try to include the flashVars in the param and embed
script:
<param name="FlashVars"
value="…………." />
<embed src="…." quality="high"
flashvars="………." name="……."
play="true" etc………………..
depending on the context, I get different javaScript
conflicts and errors…
is there a standard format to follow when creating a wrapper
for flashVars using Flex 2???
Can anyone help me, or post an example etc….?
Thanks, Jon.

First, I found this link helpful:
http://webddj.sys-con.com/read/283888.htm
All I wanted to do was see if I could pass some variables to
flash when it first started up. I found the examples in the flex 2
developer guide entitled using flashVars to not be helpful.
But I did get it working...
1. I copied the source from the browser after launching flash
from flex developer.
2. I copied this file to <project-name>/assets
directory. Don't do that. It needs to be in the
<project-name>/bin directory.
3. I tried to use the example in the flex docs...don't do
that. Instead, do a search on AC_FL_RunContent in your wrapper
html.
change this line:
"flashvars", "historyUrl=history.htm%3F&lconid=' + lc_id
+ ' ',
to something like this:
"flashvars", "historyUrl=history.htm%3F&lconid=' + lc_id
+ 'firstname=kevin',
4. In your main application file, make sure you have the
following:
<mx:Application ... initialize="initApp()"
<mx:Script>
<![CDATA[
[Bindable]
private var myName:String;
private function initApp():void{
myName = Application.application.parameters.firstname;
]]>
<mx:Label text="{myName}"/>
</Application>
Hopefully, this gets you up and running. I am by no means a
flex expert, and would appreciate feedback if the above isn't the
best way to do things.
-K
Text

Similar Messages

  • Flex Ant Tasks html-wrapper problem

    I'm getting BUILD SUCCESSFUL and an SWF file, but no HTML
    wrapper. Any help is appreciated!
    Apache Ant version 1.7.0 compiled on December 13 2006
    Buildfile:
    C:\Installs\MTCSEWorkspace\MTCSE_WebApp\flex-build.xml
    parsing buildfile
    C:\Installs\MTCSEWorkspace\MTCSE_WebApp\flex-build.xml with URI =
    file:/C:/Installs/MTCSEWorkspace/MTCSE_WebApp/flex-build.xml
    Project base dir set to:
    C:\Installs\MTCSEWorkspace\MTCSE_WebApp
    [antlib:org.apache.tools.ant] Could not load definitions from
    resource org/apache/tools/ant/antlib.xml. It could not be found.
    Build sequence for target(s) `wrapper' is [compile, wrapper]
    Complete build sequence is [compile, wrapper, ]
    compile:
    [mxmlc] Loading configuration file
    C:\Installs\MTCSEStudio\Flex Builder 3
    Plug-in\sdks\2.0.1\frameworks\flex-config.xml
    [mxmlc]
    C:\Installs\MTCSEWorkspace\MTCSE_WebApp\target\MTCSE_WebApp/ValidValueTest.swf
    (592822 bytes)
    wrapper:
    BUILD SUCCESSFUL
    Total time: 18 seconds
    <?xml version="1.0" encoding="utf-8"?>
    <!-- flex-build.xml -->
    <project name="My App Builder" basedir=".">
    <property name="FLEX_HOME"
    value="C:\Installs\MTCSEStudio\Flex Builder 3
    Plug-in\sdks\2.0.1" />
    <property name="ANT_HOME"
    value="C:\Installs\MTCSEStudio\eclipse\plugins\org.apache.ant_1.7.0.v200706080842"
    />
    <property name="MTCSE_WebApp"
    value="C:\Installs\MTCSEWorkspace\MTCSE_WebApp" />
    <property name="DEPLOY_DIR"
    value="C:\Installs\MTCSEWorkspace\MTCSE_WebApp\target\MTCSE_WebApp"
    />
    <taskdef resource="flexTasks.tasks"
    classpath="${ANT_HOME}/lib/flexTasks.jar" />
    <target name="main">
    <mxmlc
    file="${MTCSE_WebApp}/flex_src/ValidValueTest.mxml"
    keep-generated-actionscript="false"
    output="${DEPLOY_DIR}/ValidValueTest.swf">
    <load-config
    filename="${FLEX_HOME}/frameworks/flex-config.xml" />
    <source-path path-element="${FLEX_HOME}/frameworks" />
    </mxmlc>
    <html-wrapper swf="ValidValueTest"
    output="${DEPLOY_DIR}" />
    </target>
    </project>

    Ok, on second inspection, index.html is being generated.
    However, the file attribute is unsupported.
    Using the ant Move task, I was able to accomplish what I
    wanted to do. Thanks!
    <target name="wrapper" depends="compile">
    <html-wrapper swf="ValidValueTest"
    output="${DEPLOY_DIR}" />
    <move file="${DEPLOY_DIR}/index.html"
    tofile="${DEPLOY_DIR}/ValidValueTest.html"/>
    </target>

  • Flex Ant html-wrapper task

    http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks
    Isn't there a way to use a CUSTOM template instead of one of
    the predefined ones?
    If you want to add anything additional, like telling the
    browser not to cache the swf, or detecting when the browser window
    is closed, etc, there doesn't seem to be a way to do this if you're
    using this Ant task.
    What do people usually do when they need a custom wrapper?
    Just use the version that Flex Builder generates, or run the Ant
    task one time only and modify from there? Seems to me that this is
    a pretty big omission for the html-wrapper task, unless I've missed
    something.

    Yeah, that's what I'm going to be doing, using Flex Builder's
    generated template. Of course this defeats the purpose of the Ant
    task completely.
    As for making an enhancement request- it's already been done,
    and was apparently deemed a waste of time:
    http://bugs.adobe.com/jira/browse/SDK-14195
    "Deferred" i.e. it was shrugged off as not important. Without
    even providing any kind of target date or version for "Deferred"
    features, you might as well say "This is indefinitely postponed and
    will probably never get done."
    Sorry to sound bitter but I've seen too many important
    "Deferred" issues with Flex that will probably never be resolved.
    Ever since they deferred 50% of refactoring (rename is implemented
    in FB3 but move isn't??) I've yet to be impressed with Adobe's
    responsiveness on other issues.

  • Passing flashVars with the html-wrapper command

    Hi,
    Is it possible to pass flashVars when the html template  is generated using the html-wrapper task? So that I dont have to edit  the html template to add flashVars?
    Something like this in the html wrapped swf?
    AC_FL_RunContent(
         "src", "TestApp",
         "flashVars", "myName=Danger&myHometown=Los%20Angeles",
         "width", "100%",
         "height", "100%",
         "align", "middle",
         "id", "TestApp",
         "quality", "high",
         "name", "TestApp",
         "allowScriptAccess","sameDomain",
         "type", "application/x-shockwave-flash",
         "pluginspage", "http://www.adobe.com/go/getflashplayer"
    The flashVars I want to pass when I run the html-wrapper task. 
    Thanks 
    Raghu Jakkula

    If this is still an issue please re-post your question To the Business Objects forum or purchase a support case on line and have a dedicated support engineer work with you directly.

  • Flash Builder 4.6 Standard Generate HTML Wrapper?

    I have used Flash Builder for a while now, but now I need a HTML Wrapper.
    It is said to look in Project>Properties>Actionscript Compiler, but it's not there!!!
    (There is no Flex Compiler)
    Screenshot:
    Help Would Be Helpful
    Thanks in advance...

    Anyone? If it helps, I am trying to use AlternativaPlatform, (Which needs the HTML Wrapper)
    and I can't find the option!
    Does ANYONE have thid problem?
    Oh, and I got flashbuilder for free, Cause I'm a student.
    Please reply!!!

  • How to load html in flex compiler 3.5 or more

    I want to load some html page see this in Flex 3.5 or more I followed this tutorial but somehow i think it only works in Flex 2, I even tried by unchecking Generate HTML wrapper file but no luck. Can somebody help me? Thanks

    I used this Guide to make it work.
    Download the `flexiframe` from this location
    Use `xmlns:flexiframe="http://code.google.com/p/flex-iframe/"` in your component
    and `<flexiframe:IFrame id="iFrame"  label="Google"  source="http://www.google.com" width="100%" height="100%"  />`
    That's it.. this worked for me

  • Lookin for html wrapper example

    Hi,
    All I have done so far is using the Flex Builder to generate
    the html wrapper that embeds/hosts the swf file. I am new to
    Javascript and would like to learn more about embedding the Flex
    swf in html, particularly customizing it, such as embedding
    multiple swf files in different areas of the page.
    Are there any good examples, or tutorials? Thanks!

    Hi webvalue,
    I second buabco's suggestion that you focus your efforts
    around swfobject.
    Per the post here in the Flex JIRA, Flex Product Manager Matt
    Chotin indicates that future versions of Flex will be switching to
    generating wrapper code using swfobject:
    http://bugs.adobe.com/jira/browse/SDK-15468
    The SWFObject home is here:
    http://code.google.com/p/swfobject/
    For a default Flex template using SWFObject, this link looks
    promising:
    http://olegflex.blogspot.com/2008/06/swfobject-2-flex-template.html
    hth,
    g

  • [svn:fx-3.x] 13067: Fix for html-wrapper ant task generates incorrect wrapper files for flash player version detection .

    Revision: 13067
    Revision: 13067
    Author:   [email protected]
    Date:     2009-12-17 12:48:20 -0800 (Thu, 17 Dec 2009)
    Log Message:
    Fix for html-wrapper ant task generates incorrect wrapper files for flash player version detection.
    QE notes: None.
    Doc notes: None
    Bugs: SDK-18826
    Reviewed By: Paul
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-18826
    Modified Paths:
        flex/sdk/branches/3.x/modules/antTasks/src/flex/ant/HtmlWrapperTask.java

    Could you try creating a new Firefox profile to see if that helps?
    8. Make a new profile
    Chris

  • How to save changes of HTML wrapper file?

    Hello All,
    I am working on .swf file. I am making some changes in HTML wrapper file, but the changes are saved in the file.
    Is there any other way to do it?
    Thanks.

    Swati,
    Flex does tend to auto-update the wrapper file it generates, which is frustrating if you change it and then your changes are lost. I usually make a second copy of this file in the same src folder, and then change that one. Flex will then leave it as-is (since it never controlled it) but it will be deployed to your bin-debug folder (or wherever your output goes).
    Richard

  • Creating custom html-wrapper from ANT build

    Hi,
    I have been using flex from last six month. I am facing problem while creating html-wrapper. As per my requirement, my application need to run on all the browser. But whenever I use to run application on firefox, there is some focus related problem. For that I need to set wmode='opaque' and < 
    body scroll="no" onLoad="window.document.${application}.focus();">. But I am unable to find out how to set this property in html-wrapper through ant build.
    currently I am using following and script to build my flex application.
    <!-- compile flex source code -->
    <target name="compile.flex" description="Compile the Flex source code" unless="eclipse.running">
    <taskdef resource="flexTasks.tasks" classpath="${flex.home}/ant/lib/flexTasks.jar" />
    <echo level="info">Compiling flex mxml</echo>
    <property name="FLEX_HOME" value="${flex.home}" />
    <mxmlc file="${basedir}/src/main/flex/main.mxml" output="${exploded.dir}/${project.name}.swf" actionscript-file-encoding="UTF-8" incremental="true" services="${basedir}/src/main/resources/services-config.xml" context-root="/${project.name}">
    <source-path path-element="${basedir}/src/main/resources/messages/{locale}" />
    <!-- Get default compiler options. -->
    <load-config filename="${flex.home}/frameworks/flex-config.xml" />
    <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
    <!--<source-path path-element="${view.dir}/flex/assets" />-->
    <compiler.library-path dir="${flex.lib.dir}" append="true">
    <include name="*" />
    </compiler.library-path>
    </mxmlc>
    <echo level="info">Generating html</echo>
    <html-wrapper title="${project.name}" file="${project.name}.html" application="app" swf="${project.name}" version-major="9" version-minor="0" version-revision="0" width="100%" height="100%" history="true" template="client-side-detection" output="${exploded.dir}" />
    </target>
    I have also tried to edit respective index.template.html file in flex SDK, but that also doesn't work. Please suggest what shoud I do?
    Thanks and Regards,
    Ravindar kumar

    Did you already try the narrative view?
    regards
    John
    http://obiee101.blogspot.com

  • Unable to load swf from different domain through html wrapper in Chrom

    Hi All,
           I am trying a embed a swf from different domain. My html wrapper was in one domain and swf was in another domain. I have embedded the swf into the html wrapper. When i run the html file it is loading the swf in firefox and working fine. But when i try to run the same html in chrom or IE the swf is aborted. I have crossdomain.xml file in both the servers which is also allowing both the domains. I was not able to figure out the issue. Can anybody help on this.
    regards,
    Jayagopal.

    Are you getting any errors or warnings?

  • How to re-create the HTML wrapper

    How do I re-create an html wrapper for my project? For some reason it has disappeared and I cannot rebuild one and I cannot test run the application without it.
    Thank you.
    Jeff

    Hi,
    You can re create those database links at any time
    create database link APPS_TO_APPS connect to
    apps identified by <APPS_PASSWORD>
    using
    '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=<hostname>)
    (Port=<port no>))(CONNECT_DATA=(SID=<SID_NAME>)))'
    create database link EDW_APPS_TO_WH connect to
    apps identified by <APPS_PASSWORD>
    using '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=<hostname>)
    (Port=<port no>))(CONNECT_DATA=(SID=<SID_NAME>)))'
    please replace the hostname,portno, sid_name and apps_password according to your envornment
    for more information regarding those database links,
    have a look at the following metalink notes
    FAQ: Embedded Data Warehouse Database Links Doc ID: 417825.1
    Invalid database links EDW_APPS_TO_WH and APPS_TO_APPS 207591.1
    hope it helps,
    good luck
    Edited by: oraDBA2 on Apr 10, 2009 9:51 AM

  • Flex ant html-wrapper

    I cannot get the Flex ant tasks to run.
    I have copied the lib/flexTasks.jar to my project.
    - created a Proj-config.xml
    - created a Wrapper-build.xml
    - created an External Run Config that points to my
    Wrapper-build.xml.
    I keep getting Exception Occurred Executing Command Line.
    No matter what I put in the xml file I get the same error.
    Is there anything I can do to see the flexTasks.jar kicking?
    <taskdef resource="flexTasks.tasks"
    classpath="${basedir}/flexTasks/lib/flexTasks.jar" />
    Thanks.j

    Yeah, that's what I'm going to be doing, using Flex Builder's
    generated template. Of course this defeats the purpose of the Ant
    task completely.
    As for making an enhancement request- it's already been done,
    and was apparently deemed a waste of time:
    http://bugs.adobe.com/jira/browse/SDK-14195
    "Deferred" i.e. it was shrugged off as not important. Without
    even providing any kind of target date or version for "Deferred"
    features, you might as well say "This is indefinitely postponed and
    will probably never get done."
    Sorry to sound bitter but I've seen too many important
    "Deferred" issues with Flex that will probably never be resolved.
    Ever since they deferred 50% of refactoring (rename is implemented
    in FB3 but move isn't??) I've yet to be impressed with Adobe's
    responsiveness on other issues.

  • How can I make a movable transparent main window (HTML, not FLEX)?

    Hi all-
    I'm new to AIR and coming up to speed quickly. I got a sample application up and running right away and was able to give it a transparent main window so that the corners are rounded and there is no window title bar.
    However, I can't figure out how to make it so the user can drag the application around their desktop when they click on it.
    I've seen a few FLEX examples of this but I have to work in HTML.
    Does anyone know how to set this up in HTML?
    Thanks,
    Nicholas

    "Works pretty much as I'd expect, except clicking and dragging one of the child controls in my window (e.g. a button) moves the whole window as well."
    Most user interface events (mouse up, down, etc.) "bubble" up from child elements to their parents. Since you are listening on the body element, your handler is called for every mouse down in the page since the body is the highest parent in the document.
    You can either:
    Attach the event listener directly to the element used to drag the window.
    Check the event target property to check whether the target of the event (the element moused) is a drag control.

  • Embedding HTML in Flex

    http://www.merhl.com/flex2_samples/iframe/IFrame.html
    here is the example I am learning. i can do right click on
    page to get source code. But i think i missed one called
    IFrame.mxml.
    Any one know how can i get all source code from this page?
    Or, anyone have other examples about this topic?
    Thank you.

    You could try with this one
    this one
    Though it is for Flex 1.5 it is very easy to port to F2b3.
    P.S. beware of adding param wmode="opaque" to the embed
    object

Maybe you are looking for