[flash] htmlpagina in string laden

Pagina: 1
Acties:

  • Zynth
  • Registratie: September 2001
  • Laatst online: 17:51
Ik zit met een probleempje (de search hielp niet :P)
Ik wil met flash de html van een pagina laden, in een string.
Dus niet met geturl() naar een pagina surfen oid,
maar alleen een pagina ophalen en in een string plaatsen.
dus meer zoiets als: blaat = getUrl("http://www.google.com");

is dit eigenlijk uberhaupt mogelijk in flash?

[ Voor 11% gewijzigd door Zynth op 13-11-2003 11:57 ]


  • XangadiX
  • Registratie: Oktober 2000
  • Laatst online: 18-05 15:14

XangadiX

trepanatie is zóó kinderachtig

je wilt dus eigenlijk een 'view source' doen en dan die info in een string laden?

ik weet niet eens of dat uberhaupt mogelijk is, weet je hoe je het in php of javascript moet doen?

Stoer; Marduq


  • Zynth
  • Registratie: September 2001
  • Laatst online: 17:51
ik heb al een beetje vooruitgang geboekt;
ik zag dat loadVariables ook externe pagina's ondersteund;
dan doe ik het daar wel mee.
Het probleem waar ik nu mee zit, is dat die methode blijkbaar
geen blocking read uitvoert, oftewel, de code gaat verder terwijl
nog niet alle variabelen zijn opgehaald;

code:
1
2
3
4
5
6
7
8
9
10
on (release) {
    //haalt de string "answer=0" op, of "answer=1"
    loadVariablesNum("http://www.blabla.nl/eenpagina.php", 0);
    if (answer == "1") {
        antwoord="CORRECT!";
    }
    else{
        antwoord="FOUT!";
    }
}


het probleem is nu dat welke waarde answer ook heeft, er altijd fout uitkomt
omdat de if-lus niet wacht op het voltooien van loadVariablesNum().
Is er een manier om die blocking te maken ofzo?

[ Voor 9% gewijzigd door Zynth op 13-11-2003 13:30 ]


  • GrimaceODespair
  • Registratie: December 2002
  • Laatst online: 19:51

GrimaceODespair

eens een tettenman, altijd ...

Een frame-loopje inlassen dat checkt op de de waarde van 1 van de te laden vars.

Of het LoadVars object gebruiken icm onLoad.

[ Voor 56% gewijzigd door GrimaceODespair op 13-11-2003 14:41 ]

Wij onderbreken deze thread voor reclame:
http://kalders.be


  • Zynth
  • Registratie: September 2001
  • Laatst online: 17:51
heb je misschien iets meer informatie daarover?
dan kan ik kijken of google me daarbij kan helpen :)

  • oh,when?
  • Registratie: April 2000
  • Niet online

oh,when?

...

Flash ActionScript:
1
2
3
4
5
myVar = new LoadVars();
myVar.onLoad = function() {
    trace( "Data geladen: + " this.toString() );
}
myVar.load( "IkMoetTochEensDeHandLeidingGebruiken.txt" );


oftewel...F1 in Flash. HTH. :)

"You're only as good, as what you did last week."


  • GrimaceODespair
  • Registratie: December 2002
  • Laatst online: 19:51

GrimaceODespair

eens een tettenman, altijd ...

In de opzet zoals je hem nu hebt, zou je tussen frames kunnen blijven loopen, en telkens aan het begin van de loop een "vlag"-variabele checken. Als de variabele gezet is, dan is de boel geladen. Moet je niet vergeten te checken op timeouts (bv, na 100 keer loopen, alsnog uit de loop springen).

Als je echter wat structureler te werk wilt gaan, kan je beter het LoadVars object gebruiken. Dan kun je in de onLoad van dat ding, je filmpje verder laten spelen.

offtopic:
we zijn gewoon te vriendelijke mensen Owen :P

[ Voor 6% gewijzigd door GrimaceODespair op 13-11-2003 16:03 ]

Wij onderbreken deze thread voor reclame:
http://kalders.be


  • Zynth
  • Registratie: September 2001
  • Laatst online: 17:51
hmm, ik heb nu wel genoeg informatie :)
loadVars ga ik niet gebruiken, want die
wordt alleen in flashplayer 6 ondersteund.
Ik hou het maar bij een flaggie als het niet anders kan!

  • roytanck
  • Registratie: Oktober 1999
  • Laatst online: 12-05 15:11
Hoezo zou loadVars alleen in 6 ondersteund worden? In 7 ook wel hoor...

(weefselkweekje realiseert zich ineens dat je misschien een stokoude plugin als 5 wilt ondersteunen?)

  • Jermaine
  • Registratie: Januari 2003
  • Laatst online: 13-05 18:48
Even een topicje omhoog schoppen wat m'n aandacht trok; zijn er manieren om simpele tabelletjes in HTML weer te laten geven in Flash dmv loadvars?

Het lukt me niet om het volgende stukje goed weer te laten geven
code:
1
2
3
4
5
6
7
8
9
10
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>bla</td>
    <td>bla</td>
  </tr>
  <tr>
    <td>bleh</td>
    <td>bluh</td>
  </tr>
</table>


Het enige wat je ziet is 'blablablehbluh' :?

  • XangadiX
  • Registratie: Oktober 2000
  • Laatst online: 18-05 15:14

XangadiX

trepanatie is zóó kinderachtig

Jermaine, een zoektocht op macromedia had je al geholpen, het staat ook in de actionscript help:
Supported HTML tags
This section lists the built-in HTML tags supported by Flash Player. You can also create new styles and tags using Cascading Style Sheets; see Formatting text with Cascading Style Sheets.

Anchor tag (<a>)
The <a> tag creates a hyperlink and supports the following attributes:

href Specifies the URL of the page to load in the browser. The URL can absolute or relative to the location of the SWF file that is loading the page.
target Specifies the name of the target window to load the page into.
For example, the following HTML snippet creates the link "Go home," which opens www.macromedia.com in a new browser window.

<a href="../home.htm" target="_blank">Go home</a>

You can also define a:link, a:hover, and a:active styles for anchor tags by using style sheets. See Styling built-in HTML tags.

Bold tag (<b>)
The <b> tag renders text as bold. A bold typeface must be available for the font used to display the text.

<b>This is bold text.</b>

Break tag (<br>)
The <br> tag creates a line break in the text field, as shown in this example:

One line of text<br>Another line of text<br>

Font tag (<font>)
The <font> tag specifies a font or list of fonts to display the text.

The font tag supports the following attributes:

color Only hexadecimal color (#FFFFFF) values are supported. For example, the following HTML code creates red text.
<font color="#FF0000">This is red text</font>

face Specifies the name of the font to use. You can also specify a list of comma-separated font names, in which case Flash Player chooses the first available font. If the specified font is not installed on the playback system, or isn't embedded in the SWF file, then Flash Player chooses a substitute font.
Example:

<font face="Times, Times New Roman">This is either Times or Times New Roman..</font>

For more information on embedding fonts in Flash applications, see TextField.embedFonts and Setting dynamic and input text options.

size Specifies the size of the font, in pixels. You can also use relative point sizes (+2 or -4).
<font size="24" color="#0000FF">This is green, 24-point text</font>

Image tag (<img>)
The <img> tag lets you embed external JPEG files, SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. This tag is supported only in dynamic and input text fields that are multiline and wrap their text.
Table tags worden niet ondersteunt, maar met losse textfields en het breken van de string kom je natuurlijk ook een heel eind.

[ Voor 6% gewijzigd door XangadiX op 16-12-2004 20:29 ]

Stoer; Marduq

Pagina: 1