Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text u AS
Author Message
KRALJ Offline
Novi korisnik
*

Posts: 5
Joined: Jul 2007
Reputation: 0
Post: #1
Text u AS
Ovako.

Uspio sam da mi se text loadira sa servera. Text je pohranjen u Notepadu.

Ovo je kod koji sam koristio;

var lorem_lv:LoadVars = new LoadVars();
lorem_lv.onData = function (src:String):Void {
    if (src != undefined) {
        my_txt.text = src;
}

else {
        my_txt.text = "Unable to load external file.";
    }
}
lorem_lv.load("http://www.ofir.hr/luka/flash.txt");


Problem se javlja u obliku što bi htio urediti taj text u AS-u.
Zapovjed <b>onda text</b> ne ćini što bi trebala. Gdje da je postavim, što da ukucam i što još nedostaje?
Hvala
(This post was last modified: 27-08-2007 07:13 PM by KRALJ.)
27-08-2007 07:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
oriobilly Offline
Redoviti posjetitelj
**

Posts: 288
Joined: Jan 2007
Reputation: 5
Post: #2
RE: Text u AS
Evo da i ja budem konačno nekome od pomoći !!!

Nadam se da hoću Hmmm

To se može napraviti upotrebom CSS-a.

Kod za AS :
Code:
var myStyle:TextField.StyleSheet = new TextField.StyleSheet();
myStyle.load("sample.css");
content_txt.styleSheet = myStyle;

content_txt.multiline= true;
content_txt.wordWrap = true;
content_txt.html = true;

var story:XML = new XML();
story.ignoreWhite = true;
story.load("sample.txt");
story.onLoad = function () {    
    content_txt.htmlText = story;
}

Sada CSS-u kojem dodaješ nazive stilova i karakteristike !:
Code:
headline {
  font-family: Arial,Helvetica,sans-serif;
  font-size: 24px;
  font-weight: bold;
  display: block;
}
subheadline {
  font-family: Arial,Helvetica,sans-serif;
  font-size: 13px;
  font-weight: bold;
  display: block;
}
mainBody {
  font-family: Arial,Helvetica,sans-serif;
  font-size: 10px;
  display: block;
}
biline {
  font-family: Arial,Helvetica,sans-serif;
  font-size: 11px;
  font-style: italic;
  display: inline;
}
A {
  font-family: Arial,Helvetica,sans-serif;
  color:cccccc;
  font-size: 10px;
  display: inline;
  text-decoration:underline;
}

I na kraju text !!! Tu naravno možeš ubasiti i neku sliku !!!

Code:
<body>
  <headline>Primjer Formatiranog texta</headline>
  <subheadline>By ORIOBILLY I NARAVNO MACROMEDIA</subheadline>

<biline>Today - Our City </biline><mainBody>A giant sea lion was spotted today rampaging around the city's main square, scaring thousands of innocent people just out for a daily stroll in the beautiful downtown district.
<img align='right' src='sample.jpg'/>No injuries were reported after the animal's two-hour assault of the shopping district famous for it's sea lion purses and shoes, also known as the "sea lion district". Witnesses said the creature came out of the ocean near the Burger King at 42nd and 1st Avenue, startling many and stalling traffic.
"The animal caused nearly four million dollars of damage to the neighborhood," said Joseph Valente, owner of "Sea Lions R' Us" at 43rd and 2nd. Onlookers to the scene said that the sea lion appeared ornery, but otherwise in good spirits.  
Officials are uncertain as to when, if ever, the sea lion may return.<A HREF="http://www.macromedia.com">Click here for more.</A> </mainBody>
</body>


Flash spremi kao "sample.swf"
CSS spremi kao "sample.css"
Text spremi kao "sample.txt"
U isti folder gdje to spremiš možeš dodati i neku manju sliku kuju češ spremiti kao "sample.jpg"

To bi bilo to !!
Nadam se da sam uspio pomoči po prvi puta Rofl

Toliko za ovaj puta.Palac-gorePalac-gorePalac-gore

P.S U prilogu i primjeri !


Attached File(s)
.rar  Primjer.rar (Size: 90.28 KB / Downloads: 12)

Divno je biti nekome nešto !!!
(This post was last modified: 28-08-2007 02:05 AM by oriobilly.)
28-08-2007 02:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
hamferus Offline
Forumaš
***

Posts: 350
Joined: Jun 2006
Reputation: 8
Post: #3
RE: Text u AS
Da oriobilly se protrudio i napiso ti ljepo rješenje. Pošto sam ti odgovorio na pp evo i odgovora tu.

Probaj promijenit ovo:
Code:
my_txt.text = src;

u ovo:

Code:
my_txt.htmlText = src;

PHOTO - http://www.hamferus.com
VIDEO - http://www.metacafe.com/f/channels/hamferus/
RC WORLD - http://rcfanatic.blogspot.com
FLASH TUTORIJALI - http://blog.hamferus.com
28-08-2007 11:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Mina Offline
Novi korisnik
*

Posts: 27
Joined: Feb 2008
Reputation: 0
Post: #4
RE: Text u AS
Evo i pocetnickog pitanja za ovaj topic. Kako uploadovanom textu iz externog .txt filea odrediti vrstu fonta (predpostavljam u AS-u ali kako)?
14-03-2008 09:55 PM
Find all posts by this user Quote this message in a reply
oriobilly Offline
Redoviti posjetitelj
**

Posts: 288
Joined: Jan 2007
Reputation: 5
Post: #5
RE: Text u AS
Kada napraviš dinamično text polje u njegovom Properties-u odrediš sve parametre kao što su Font,veličina, centriranje,boja i sve ostalo što ide uz podešenje texta.

Divno je biti nekome nešto !!!
15-03-2008 12:45 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Mina Offline
Novi korisnik
*

Posts: 27
Joined: Feb 2008
Reputation: 0
Post: #6
RE: Text u AS
oriobilly Wrote:Kada napraviš dinamično text polje u njegovom Properties-u odrediš sve parametre kao što su Font,veličina, centriranje,boja i sve ostalo što ide uz podešenje texta.

Dobro, to mi je jasno, to je normalna procedura za bilo kakav text. Moje pitanje je vezano za text koji se pise u text documenutu (.txt) i koji se poziva iz externog filea (van fla dokumenta), a koji u sebi moze da ima i razliciti font, razlicitu velicinu i boju, mozda i neki efekat ucitavanja (iz blura, itd.). Ne bi li trebalo da se sve to zadaje u AS-u?
15-03-2008 01:14 PM
Find all posts by this user Quote this message in a reply
oriobilly Offline
Redoviti posjetitelj
**

Posts: 288
Joined: Jan 2007
Reputation: 5
Post: #7
RE: Text u AS
Nema veze kako je text napisan u extenom textualnom dokumentu,ako se učitava u dinamično text polje biti če prikazano po parametrima todga dinamičnog text polja.
Ako želiš da sav text ne bude jednak nego želiš da neki djelovi texta budu podebljani,drugačije boje ili čak da budu linkovi onda trebaš omogučiti HTML tagove unutar toga dinamičnog text polja.Naravno onda u tome textualnom externom dokumentu moraš pisati text kao HTML.
Flash filtere ne možeš primjeniti na samo neke djelove externog texta nego na sve ili ništa.
Znači Blur ne može biti primjenjen na samo neke djelove texta nego na cijeli text.

Divno je biti nekome nešto !!!
16-03-2008 12:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)