Re: [flexcoders] Re: loading a external variable into a flex app

2007-01-02 Thread greg h

Guille,

fyi ... I too am a Flash user.  Flex 2's debug capabilities are a phenomenal
advance for developers like us.  I have some notes below regarding FREE
DEMOS OF DEBUGGER you might want to check out over at
Lynda.com
.

Taking the queue from Tracy's post I went back and looked at what I have in
"the wrapper".

Following are some steps for creating a miminal test application.  Sorry for
this all to be so convoluted.  Please give the following a try and post back
whether it works for you or not.  If not, I will try to zip up my working
sample project.

hth,

g

TEST APPLICATION

As a test using FlashVars I created a new project in Flex Builder 2 putting
in the project's main application file the  at this link:
http://livedocs.macromedia.com/flex/2/docs/1004.html

I then ran the project from Flex Builder (CTL-F11).  This generated in the
/bin directory the wrapper html files.

In the non-debug .html file, I found the following block (in mine at line
61):
} else if (hasRequestedVersion) {

And following it, the following function call (in mine starting at line 64):
AC_FL_RunContent(

In this function call was the following line (in mine at line 73):
"flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '',

To pass in the FlashVar values referenced in the MXML sample code, I
modified the above to be as follows (prepend the additional string inside
the first set of single quotes):
"flashvars",'myName=Hello World&myHometown=Anytown&historyUrl=
history.htm%3F&lconid=' + lc_id + '',

With that done, I went back to the MXML application and again ran it using
CTL-F11.

If you do not see the FlashVars coming through, in the browser execute a
view source to make sure that the modified .html wrapper did not get
overwritten.  For instance, in the view source search for the string: myName

If this works and you want to play around with the debugging, make the same
modifications as above to the file in the /bin directory ending -debug.html


FREE DEMOS OF DEBUGGER

Flex 2 Beyond the Basics with: David Gassner
http://movielibrary.lynda.com/html/modPage.asp?ID=290
1. Debugging
Overview 1:37 1.5 MB
The debugging perspective 4:26 6.7 MB
Debugging and tracing your code 7:22 11.9 MB
Using breakpoints 6:53 10.4 MB
Watching variables and expressions

If you do not already have an account with Lynda.com ,
you can get a 1 day free pass here:
http://www.lynda.com/freepass/24



On 1/2/07, g_vaccarezza <[EMAIL PROTECTED]> wrote:


greg,

I'm effectively calling initApp() as



I also changed the HTML code for both the regular html and the debug
html (since I didn't know which was the "right" one, I changed both).
Really winder what's going on!

As for the checkpoint or a trace() statement...
I'm having a hard time getting around flex debugging... I'm a Flash
user and I'm used to the test movie enviroment (ctrl+enter) where I
can easily use the output window to check for traces...
I know this is completely retard but I can only test my flex apps in
the browser which ain't really helpful. I wonder if there's anything
like a test enviroment within flex?

Thanks a lot!
Guille



Re: [flexcoders] Re: loading a external variable into a flex app

2007-01-02 Thread Michael Klishin
Check out this or use debug mode with Debug Flash Player:

https://addons.mozilla.org/firefox/3469/

On 03/01/07, g_vaccarezza <[EMAIL PROTECTED]> wrote:

> As for the checkpoint or a trace() statement...
> I'm having a hard time getting around flex debugging... I'm a Flash
> user and I'm used to the test movie enviroment (ctrl+enter) where I
> can easily use the output window to check for traces...
> I know this is completely retard but I can only test my flex apps in
> the browser which ain't really helpful. I wonder if there's anything
> like a test enviroment within flex?

-- 
This was freedom. Losing all hope was freedom.

Flex wiki (russian): flexwiki.novemberain.com
Red5 bug track: jira.red5.org
Red5 wiki: wiki.red5.org [use JIRA account]

Chasing the beauty in programming:
www.ruby-lang.org | www.rubyonrails.org


RE: [flexcoders] Re: loading a external variable into a flex app

2007-01-02 Thread Tracy Spratt
I've not worked with the wrpper in 2.0 yet, but I recall reading that
parameters get read from a AC_OETags.js file, and not from the object
tag itself.

Tracy



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of greg h
Sent: Tuesday, January 02, 2007 4:55 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: loading a external variable into a flex
app

 

hi guille,

Just to double-check, are you calling initApp()?  

For instance:




If that is ok, confirm which html "wrapper" is being called.  (e.g. Flex
Builder uses separate wrappers for debug and non-debug).
 
Also, for increased visibility into what is happening at runtime you can
add a checkpoint on the initApp() method.  Then you can step through the
processing and possibly see in the Variables panel the contents of
Application.application.parameters.  Or add a trace() in the method to
confirm that it is at least executing.

Please post back whether or not any of this helps.

hth,

g 

On 1/2/07, g_vaccarezza <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Hi G!

Code seems to be fine, but it ain't seem to be working. I wrote the
following code withing Flex:

// call on creation complete

private function initApp():void{
   myExternalUrl = Application.application.parameters.theUrl ;
   requestText.text = myExternalUrl;
}

and then, within the  tag in the HTML:



I open the HTML witht eh Flex app, but the textbox wont show anything. 

Any Suggestions?
Thanks!
-g

--- In flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ,
"greg h" <[EMAIL PROTECTED]> wrote:
>
> Hi g,
>
> This page in the Flex 2 Language Reference covers ... 
> Using query string parameters  (under "NOTE" halfway down the page)
> http://livedocs.macromedia.com/flex/2/docs/1006.html
<http://livedocs.macromedia.com/flex/2/docs/1006.html>  
>
> Personally, I use FlashVars to pass values into the SWF at runtime
through
> the HTML  tags.
>
> You can check these two links in the Flex 2 Language Reference for 
details:
>
> Using flashVars
> http://livedocs.macromedia.com/flex/2/docs/1005.html
<http://livedocs.macromedia.com/flex/2/docs/1005.html> 
>
> Using the Application.application.parameters object
> http://livedocs.macromedia.com/flex/2/docs/1004.html
<http://livedocs.macromedia.com/flex/2/docs/1004.html> 
>
> Please post back whether this helped or not.
>
> g 

 

 



Re: [flexcoders] Re: loading a external variable into a flex app

2007-01-02 Thread greg h

hi guille,

Just to double-check, are you calling initApp()?

For instance:


If that is ok, confirm which html "wrapper" is being called.  (e.g. Flex
Builder uses separate wrappers for debug and non-debug).

Also, for increased visibility into what is happening at runtime you can add
a checkpoint on the initApp() method.  Then you can step through the
processing and possibly see in the Variables panel the contents of
Application.application.parameters.  Or add a trace() in the method to
confirm that it is at least executing.

Please post back whether or not any of this helps.

hth,

g

On 1/2/07, g_vaccarezza <[EMAIL PROTECTED]> wrote:


Hi G!

Code seems to be fine, but it ain't seem to be working. I wrote the
following code withing Flex:

// call on creation complete

private function initApp():void{
   myExternalUrl = Application.application.parameters.theUrl;
   requestText.text = myExternalUrl;
}

and then, within the  tag in the HTML:



I open the HTML witht eh Flex app, but the textbox wont show anything.

Any Suggestions?
Thanks!
-g

--- In flexcoders@yahoogroups.com, "greg h" <[EMAIL PROTECTED]> wrote:
>
> Hi g,
>
> This page in the Flex 2 Language Reference covers ...
> Using query string parameters  (under "NOTE" halfway down the page)
> http://livedocs.macromedia.com/flex/2/docs/1006.html
>
> Personally, I use FlashVars to pass values into the SWF at runtime
through
> the HTML  tags.
>
> You can check these two links in the Flex 2 Language Reference for
details:
>
> Using flashVars
> http://livedocs.macromedia.com/flex/2/docs/1005.html
>
> Using the Application.application.parameters object
> http://livedocs.macromedia.com/flex/2/docs/1004.html
>
> Please post back whether this helped or not.
>
> g