Avatar billede globulous Nybegynder
19. december 2004 - 21:19 Der er 7 kommentarer og
1 løsning

Webservice call from object tag to _level0

Hi. Heres a challenge for ya.
Im trying to pass a webservice http address from an object tag to the root in the embedded swf. From there I parse it and split it into objects. I looks like this when embedded:
<PARAM NAME=FlashVars VALUE="&my_service=http://vmcmswaqagj/gj/webservices/gj_iwish.asmx/GetIwishText?LanguageCode=en&"> which I put in the embed tag as well.

Ive also tried utf-8 URL encoding where it looks like this

http%3a%2f%2fvmcmswaqagj%2fgj%2fwebservices%2fgj_iwish.asmx%2fGetIwishText%3fLanguageCode%3den
Ive tried splitting it into strings and reassembling it in flash

path=http://vmcmswaqagj/gj/webservices/gj_iwish.asmx/GetIwishText?LanguageCode&lang=en&

if I put it difectly in my flash file (that is, I dont get it out of the object tag), it works a charm! I can get it from object tag and javascript trace the stringin and it even looks right and everything, but when I go to parse it, it disappears even though it looks just like the on one that I put in directly.

Has anyone ever had this problem??
Avatar billede heeris Nybegynder
19. december 2004 - 22:11 #1
Im not sure I understand completely, could you send the project to me maybe? dheeris@gmail.com
Avatar billede nikolajdu Nybegynder
19. december 2004 - 22:20 #2
I have! It appears that FlashVars cannot handle certain strings. My solution was to split it up and join it again inside flash. Stupid but working.

http://www.eksperten.dk/spm/495776

I urlencoded my string and split it up after the domain:

<param name="FlashVars" value="short1=http:%2F%2Fwww.mydomain.com&amp;short2=%2Fis-bin%2FINTERSHOP.enfinity%2FWFS%2Froot%2Fen_US%2F-%2FUSD%2FSWF-XML;sid=JXdZdqd7tXT_w-fgqVVIfKZx-L-1oKAydxryDi_hNY2U8kNDak1JjGr_wU8WTHqzyaE=%3FPreView=false&amp;ComponentID=R6MKAQoduYsAAAD86nbQ_1p_&amp;TransformerID=isunit:%2F%2FStyles%2FStreamingVideo%2FGenerateFlashXML.dtpl&amp;">

short1 short2 goes into flash and then inside I did:

_level0.xmlServicePath = short1.toString()+short2.toString()+"&ComponentID="+ComponentID.toString()+"&TransformerID="+TransformerID.toString();

Beware of ComponentID and TransformerID - They go into flash a parts because the original url has & (urlencoded == &amp; ) in it and therfore split the string up.

questions?
Avatar billede globulous Nybegynder
20. december 2004 - 00:55 #3
NICOLAIDU!! you never fail to surprise me...Thanks...send svar and Ill send points
Avatar billede nikolajdu Nybegynder
20. december 2004 - 01:09 #4
Oki doki :))
Avatar billede nikolajdu Nybegynder
20. december 2004 - 01:11 #5
Iøm happy you understood my english even though theres was a couple of errors. should off course has been : into flash as parts and split up the string. Danglish will fireEver be my bedst ;-)
Avatar billede barklund Nybegynder
20. december 2004 - 02:36 #6
Well, I'll just correct some mistakes here:

1)

"Ive also tried utf-8 URL encoding where it looks like this

http%3a%2f%2fvmcmswaqagj%2fgj%2fwebservices%2fgj_iwish.asmx%2fGetIwishText%3fLanguageCode%3den" - globulous

Well, that works perfectly? I fail to see the problem here.

I've created a very small demo of exactly your problem here:

http://actionscript.dk/eksperten/flashvars/

And it works fine in both IE and Firefox.

2)

"They go into flash a parts because the original url has & (urlencoded == &amp; ) in it and therfore split the string up." - nikolajdu

No. & url-encoded is NOT &amp; - that is an SGML/XML encoding which has nothing to do with the current situation. & url-encoded is %26 - and works fine in a flashvars-tag as well and parses correctly to the correct walue in flash.

Just my 2 (european) cents. :)

--
Morten Barklund
Avatar billede nikolajdu Nybegynder
20. december 2004 - 07:43 #7
Barklund my problem was´nt to get the url into flash but to get it working inside flash. Í traced the url inside Flash and had the correct value - But then tried a simple getURL(value) and I failed - It simply broke the string - this was my workaround

Thnx for the obvious correction with &amp;
Avatar billede nikolajdu Nybegynder
20. december 2004 - 07:48 #8
by the way I was publishing as Flash player 6 - might have something to say.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester