Color conversion

Hello all

im working on a vb6 application that calls a flash movie. everything works perfectly well. The only thing that doesnt work is the color conversion. im using the common dialogue control.showColor in vb6 which displays a whole lot of colors. i have written a function that converts the decimal value of the displayed colors to hexadecimal which is then passed to the flash application. The problem i am facing now is that when i select a color from the common dialogue control color panel in the vb6 application some of the colors appear correctly in the flash application whilst some others do not appear correctly.

example

FFFFFF which is the hexadecimal value for white shows perfectly well

wheras FF8000 which is supposed to show blue shows orange. i dont know what the problem is. Please help me out.

this is the function i have which converts the decimal value to hexadecimal

Public Sub Decimal_to_HEX(DecimalValue As Long)

  'This line will convert a Long decimal to Hexadecimal
  HexadecimalValue = Hex(Val(DecimalValue))
  If Len(HexadecimalValue) < 6 Then
        'Give is 6 digits for easy RGB conversion.
        HexadecimalValue = String(6 - Len(HexadecimalValue), "0") + HexadecimalValue
       
       Endif

End Sub

korkor5