ActionScript 3.0 :: Embed Stylesheet And Load It On Demand
Oct 16, 2009
I'm trying to implement way so that stylesheets can be loaded on demand: Either the default stylesheet is used, which is compiled into the application file, or a remote stylesheet (.swf) is loaded if the default styles should not be used. (each stylesheet has embedded images)
So what I would like to do is:
1) Embed the stylesheet but not load it right away. Instead, store a reference to it inside a variable. (or simply a path string?)
2) Load the requested stylesheet, for example using StyleManager
My way of tackling the problem was like this:
1) Embed the default stylesheet as
Code:
[Embed(source="assets/themes/default.theme.swf")]
_defaultThemeClass:Class;
and turn it into a StyleSheet object
2) Have a separate class decide which stylesheet to use and call StyleManager.loadStyleDeclaration(myStyle), where myStyle can either be the remote or local stylesheet.
As it seems, the StyleManager cannot load a local stylesheet. So I'm looking for a way to "activate" the style I have embedded.
We have a flex application which compiles fine on windows box using mxmlc ant task but when we try to run the same build scripts on linux, it throws the 'Invalid Embed directive in stylesheet' error indicating it is not able to resolve the path to the image files.
Can someone pls. educate me on if there is a difference in the way the image files are looked up, in a CSS file, on windows vs linux.
Flex sdk version is 3.3. The same sdk is used on both windows and linux. Not sure if this has been fixed by any future 3.x sdks.
I have a text area, content_txt, that I load html with a stylesheet into using this code:
Code: //code for loading CSS and text into swf; function getRotatorStyles() {[code]....
The problem is that content_txt.maxscroll always returns 1, but I know from testing that the actual value is 121. content_txt.htmlText .maxscroll, content_txt.text.maxscroll, content_txt._text.maxscroll, all return undefined. How can I get an accurate value of maxscroll for this text area? I need it to get a custom scroll bar to work correctly.
I imported two projects in Flex Builder 3 (A and B). Those two projects A and B are in the same folder and in mxml file which is located in A/src I have
<mx:Style source="../../B/b/assets/b.css" />
this relative path is correct, but Flex Builder keeps showing message: "Problem finding external stylesheet: ../../B/b/assets/b.css"
What am I doing wrong? Btw, I am newbie in flex, so,
I am looking to develop a simple flash progrma that allows me to create custom slide shows on the fly. I have about 8 different countries that i have photos for and I want to have a front page that via checkboxes you can select the countries to view which will then populate a slideshow/gallery with the relevant photos.
I have a project where I load a bunch of images into a scroll pane object. There are only 4 visible at a time, and there may be hundreds. The user can change the dates of the images, delete images and the like. Each action calls web services to enact the function in the database, so reloading is required after each user action. As a result, when there are more than, say, 20 images, it is a SLOW application. What's the best way to only load a certain number of images, say 12 - until they are actually needed? So basically only load the images that would be visible in the scroll pane at any given point? So if they wanted to scroll way to the bottom and see the last 10 images, we never need to load the 200 images in the middle.
what to search for on the internet for an example. "progressive" only gives me info on jpgs...!
At the moment i am using vlc to transcode my video realtime and display the output through Flowplayer.The problem is that I am struggling to seek using flowplayer my time gets out of sync between the stream and flowplayer and there are a few other issues.Are there any streaming servers that allow for real time transcoding and allow for a flash player to seek.
i'm having problems trying to play FLV videos on demand from Flash Media Server 3.0.1.
Sometimes the video doesn't show at all, sometimes it plays the audio only, and sometimes it works perfectly...i can't figure out why.
Videos are into the applications/vod/media folder, i'm using a MediaDisplay object to load them, and i've exported the SWF as a Flash Player 7 AS2 application.
Code: Select all // m is the mediadisplay object m.setBufferTime(10); // file will be passed as parameter
[Code]....
as you see, the server is in my local network, but i've tried with a public remote server too, with the same results.
I wanna do some slide show, getting some seconds of some MPGs , is it possible to do that My ideia is, create a XML files containing the names and the paths of the MPEGs, and at each 10 seconds, change the file.
Throwing this out there. I would like to know how to haveflash grab an XML URL from the embed tag (i.e. embed src=""flashvars="profile=http://xmlfile.xml". Reason:I make thesemyspace templates for people to use, but they can only be edited bypeople who own flash. If the user could edit an XML file with allof their content, then they would be able to use the layoutsregardless of whether or not they have flash. Does anyone here know how to do this? I believe it issomething like this on an actions layer:
I have a basic video on demand app running on Flash Media Interactive 3.5. I've noticed that in our flowplayer page, in order to view the contents I have to set the netconnectionurl to be the address to the app, and then the file name url needs to contain the rest of the path. For Example: NetConnectionURL: rtmp://myserver.edu/appname/ Url: path/to/file/many/folders/deep/video.mp4
However - I have accessed the same file from a different server using the following: NetConnectionURL: rtmp://myserver.edu/appname/path/to/file/many/folders/deep/ Url: video.mp4 What type of VOD application or settings need to be configure to allow the later example to work?
We've purchased the FMS 4.5 and are now planning an application that lets users record a video to the server using their webcam. Straight forward, if we were to stream only to a flash video object. BUT, we would like our padders to be able to see the videos on demand too. Can't find a tutorial on this, seems like everyone's more interested in live streams.The server is able to record a stream in mp4, but when I'm testing these files in Adobe Media Player it won't play :| What codec is used, and is it possible to play this format on an iPad? If not, is there som sort of solution other than manually transcode to the right format.
I have a component and I add some content to it making it change it's size, immediately I need it's new size, but flex only updates the size in the next frame by calling updateDisplayList. how can I force it to update the size of the component right away.
Being a code purist, I always set Flash to demand that I declare all variables/functions with a type. Like this:var myVar1:int = 14; //Okvar myVar2 = 18; //Compiler ERRORMy problem is that I just reinstalled my computer (including Flash) but I've forgotten where I do this setting. Anyone here with a better memory than me?
I'm using the following code to embed the swf and load a file via flashvars. It works fine in firefox...but does not work in IE. I'm convinced that the issue is in my html syntax. Can anyone spot the problem?
I need to create a flash intro. One of those that sits on top of the page for a couple of seconds, showing publicity but with some transparency for the users to see what's under it (the page itself). Can anyone tell me how to do that? I just can't seem to find a way to load a flash swf without being embed on the page.
I was wondering is it possible to load or embed dynamically new fonts?
In my current project the option would be needed. Situation is, I don't know what is the font and what would be the address of the font. So is there a way to bring new type faces in dynamically?
Here's my opinion which obviously isn't quite correct:
ActionScript Code: var fontPath:String = "C:/WINDOWS/Fonts/BirchStd.otf"; var fontFace:String = "arial"; function setFontFace():void{
[Code].....
I get errors: 'fontPath' does not have a recognized extension, and a mimeType was not provided and Unable to transcode fontAddress.
Putting there for mimetype: mimeType="application/x-font-truetype" I get rid of the first one, but second error still exist
In order to play a FMS stream (live or on demand), either an FLVPlayback component or the Video class is needed.And they require ActionScript 3 and Flash 8 or above.
As far as i know , Youtube, Dailymotion and Google Video stream their on demand videos from a FMS, and their players are compatible with Flash 7.
How can they achieve this? If Youtube, Google and Dailymotion do that, i deduce it's possible..
I tried to create a Flash 7 application that plays a video coming from FMS, using a MediaDisplay component, but it doesn't work well. Sometimes it shows the video, sometimes not.So i don't think youtube player uses MediaDisplay..
I have an mxml pie chart, which I would like to rotate slowly prior to a button click, however on click it needs to stop immediately (or at least reasonably quickly) and then the callout labels are introduced with a fade.
I have experiemented with both a timer function to achieve this:
I have a ERROR message is Code: ArgumentError: Error #2126: NetConnection object must be connected. at flash.net::NetStream/ctor() at flash.net::NetStream() at videoplayer1_fla::MainTimeline/initVideoPlayer() at videoplayer1_fla::MainTimeline/frame1()
Below code is xml playlist included. Buti want to play videos through "rtmp host". My On-demand Video Player Code ActionScript Code: // #### VARIABLES // net connection object for net stream var ncConnection:NetConnection; // net stream object var nsStream:NetStream; [Code] .....
Is it possible to create a flash file, which can be embedded into a website for on-demand viewing and be exported to a cd while maintaing interactivity, that is geared towards an online elearning environment? Basically a client wants a video that is broken down into various chapters with an interactive "course" for each chapter.The interacivity will included answering questions correctly in order to move on to the end of the chapter.
I am trying to config custom encryption key for different pieces of content at streaming level using jit.conf for On-demand Apple HTTP Live Streaming.I tried to set "HLSEncryptionScope content" in httpd.conf and placed jit.conf in ../webroot/vod but not success, the m3u8 generate not contains EXT-X-KEY.and, I tried and got nothing in access plugin log file while i http stream a m3u8 file, is it possible to log HTTP Live Streaming using plug-in?can plugin got any event triggered by http streaming?